From ebb14a71918b80456c57975306b6ab76e16961bc Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Thu, 16 May 2019 14:40:44 +0100 Subject: [PATCH] Uncomment execution device option in golang bindings --- tensorflow/go/graph.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tensorflow/go/graph.go b/tensorflow/go/graph.go index 31f087591b7..1524741fee5 100644 --- a/tensorflow/go/graph.go +++ b/tensorflow/go/graph.go @@ -112,17 +112,9 @@ func (g *Graph) ImportWithOptions(def []byte, options GraphImportOptions) error C.TF_ImportGraphDefOptionsSetPrefix(opts, cprefix) if len(options.Device) != 0 { - // TODO(ashankar): Remove this error and uncomment below - // when a release of the C library which includes - // https://github.com/tensorflow/tensorflow/commit/e0af5ac53e5a8ad9b07cdd5738c0a8e12f938c4e - // has been made. - // See https://github.com/tensorflow/tensorflow/issues/23257 - 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") - /* - cdev := C.CString(options.Device) - defer C.free(unsafe.Pointer(cdev)) - C.TF_ImportGraphDefOptionsSetDefaultDevice(opts, cdev) - */ + cdev := C.CString(options.Device) + defer C.free(unsafe.Pointer(cdev)) + C.TF_ImportGraphDefOptionsSetDefaultDevice(opts, cdev) } buf := C.TF_NewBuffer()