aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go/operation.go
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2018-07-11 18:17:25 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-11 18:21:08 -0700
commit4ddcd6999a68335daf225fbd170d70f3d733b74f (patch)
tree8d09e75cdd724842c1555d9ab887a5f277e9a38b /tensorflow/go/operation.go
parent5574d6041a5a5d91c4be3449d7a456a146da4c0e (diff)
[Go]: Support device annotations when constructing graphs.
PiperOrigin-RevId: 204225504
Diffstat (limited to 'tensorflow/go/operation.go')
-rw-r--r--tensorflow/go/operation.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/go/operation.go b/tensorflow/go/operation.go
index 25ec718703..d6a37e0a86 100644
--- a/tensorflow/go/operation.go
+++ b/tensorflow/go/operation.go
@@ -45,6 +45,12 @@ func (op *Operation) NumOutputs() int {
return int(C.TF_OperationNumOutputs(op.c))
}
+// Device returns a specification of the device on which this operation
+// will be executed, or the empty string if there is no such specification.
+func (op *Operation) Device() string {
+ return C.GoString(C.TF_OperationDevice(op.c))
+}
+
// OutputListSize returns the size of the list of Outputs that is produced by a
// named output of op.
//