Skip to content

Commit 6f09a09

Browse files
asimshankartensorflower-gardener
authored andcommitted
[Go]: Fix #23257
By temporarily disabling the features introduced in PR #20412 Will re-enable after the C libraries for TensorFlow 1.13 or later have been released. PiperOrigin-RevId: 223079148
1 parent f1d0c84 commit 6f09a09

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎tensorflow/go/graph.go‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,17 @@ func (g *Graph) ImportWithOptions(def []byte, options GraphImportOptions) error
112112
C.TF_ImportGraphDefOptionsSetPrefix(opts, cprefix)
113113

114114
if len(options.Device) != 0 {
115-
cdev := C.CString(options.Device)
116-
defer C.free(unsafe.Pointer(cdev))
117-
C.TF_ImportGraphDefOptionsSetDefaultDevice(opts, cdev)
115+
// TODO(ashankar): Remove this error and uncomment below
116+
// when a release of the C library which includes
117+
// https://github.com/tensorflow/tensorflow/commit/e0af5ac53e5a8ad9b07cdd5738c0a8e12f938c4e
118+
// has been made.
119+
// See https://github.com/tensorflow/tensorflow/issues/23257
120+
return fmt.Errorf("GraphImportOptions.Device is only supported with the TensorFlow C library versions after 1.12 (or built from master). See https://github.com/tensorflow/tensorflow/issues/23257")
121+
/*
122+
cdev := C.CString(options.Device)
123+
defer C.free(unsafe.Pointer(cdev))
124+
C.TF_ImportGraphDefOptionsSetDefaultDevice(opts, cdev)
125+
*/
118126
}
119127

120128
buf := C.TF_NewBuffer()

0 commit comments

Comments
 (0)