[Go]: Allow code in the "master" branch to work against the latest C library

(1.12)

Fixes #23257 for now.
A more principled way of ensuring that we don't end up in this situation
as the Go API is updated to use new C API features remains to be investigated.

PiperOrigin-RevId: 228856302
This commit is contained in:
Asim Shankar 2019-01-11 03:03:43 -08:00 committed by TensorFlower Gardener
parent bb87d0021f
commit cdbaf19b7b

View File

@ -123,13 +123,22 @@ func (th *TensorHandle) DeviceName() (string, error) {
// BackingDeviceName returns the name of the device in whose memory the tensor
// handle resides. This function will block till the operation that produces
// `h` has completed.
//
// WARNING: The implementation currently returns the same as DeviceName().
// After TensoFlow 1.13's C library is released, this implementation will
// be updated to return what the documentation says!
func (th *TensorHandle) BackingDeviceName() (string, error) {
// TODO(ashankar): Restore after TensorFlow 1.13 is released.
// See https://github.com/tensorflow/tensorflow/issues/23257#issuecomment-433751410
return th.DeviceName()
/*
status := newStatus()
name := C.TFE_TensorHandleBackingDeviceName(th.c, status.c)
if err := status.Err(); err != nil {
return "", err
}
return C.GoString(name), nil
*/
}
// ToTensor returns the Tensor referenced by th. It may block if this tensor is