diff options
author | Jonathan Hseu <jhseu@google.com> | 2016-08-23 12:29:10 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-08-23 13:32:55 -0700 |
commit | 31e0b3bef5fa5e2108f8923633022bbd29b3d287 (patch) | |
tree | dbb42f3f2f182ab0d70cb35466c67099f0459a8f /tensorflow/go/operation.go | |
parent | b73bad5a5aaae94bfc112bfec3adc5fea8c006df (diff) |
Rename Port to Output in the Go API.
Change: 131089292
Diffstat (limited to 'tensorflow/go/operation.go')
-rw-r--r-- | tensorflow/go/operation.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tensorflow/go/operation.go b/tensorflow/go/operation.go index 19eb1a5816..7d9a9655dc 100644 --- a/tensorflow/go/operation.go +++ b/tensorflow/go/operation.go @@ -24,17 +24,19 @@ type Operation struct { c *C.TF_Operation } -// Port represents a specific input or output of an operation, e.g. to specify -// the specific output to pass as an input to a new op. -// -// Note the difference in naming convention: Port corresponds to Tensor/Output -// in the Python API. -type Port struct { - Op *Operation +// Output represents one of the outputs of an operation in the graph. Has a +// DataType (and eventually a Shape). May be passed as an input argument to a +// function for adding operations to a graph, or to a Session's Run() method to +// fetch that output as a tensor. +type Output struct { + // Op is the Operation that produces this Output. + Op *Operation + + // Index specifies the index of the output within the Operation. Index int } -func (p *Port) c() C.TF_Port { +func (p *Output) c() C.TF_Port { return C.TF_Port{oper: p.Op.c, index: C.int(p.Index)} } @@ -67,7 +69,7 @@ func (b *opBuilder) SetAttrType(name string, typ DataType) { C.free(unsafe.Pointer(attrName)) } -func (b *opBuilder) AddInput(port Port) { +func (b *opBuilder) AddInput(port Output) { C.TF_AddInput(b.c, port.c()) } |