diff options
author | Asim Shankar <ashankar@google.com> | 2016-10-11 21:39:46 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-10-11 22:49:45 -0700 |
commit | b17bbb58663502f0b1f45cf278ce7c0573f92154 (patch) | |
tree | 201446643aa556451d2b86df5e6820d1662fd3b2 /tensorflow/go/tensor.go | |
parent | 6b905241ecd462f1629ed24d0f9b3746187d5933 (diff) |
go: Introduce a Scope for graph construction.
The Scope encapsulates common properties of operations being added to the
graph. The plan is for all generated wrapper functions for ops to consume a
Scope as their first argument. This is similar to the Scope class in the C++
API.
The Scope object defined here is far from complete, but I wanted to get this
out so that I can start on code generation for the wrapper functions for ops.
While at it, also defined named constants for DataType.
Another step in the journey towards #10
Change: 135882730
Diffstat (limited to 'tensorflow/go/tensor.go')
-rw-r--r-- | tensorflow/go/tensor.go | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tensorflow/go/tensor.go b/tensorflow/go/tensor.go index 76a4615a7b..b1c34b6cd5 100644 --- a/tensorflow/go/tensor.go +++ b/tensorflow/go/tensor.go @@ -27,9 +27,32 @@ import ( ) // DataType holds the type for a scalar value. E.g., one slot in a tensor. -// The values here are identical to corresponding values in types.proto. type DataType C.TF_DataType +// Types of scalar values in the TensorFlow type system. +const ( + Float DataType = C.TF_FLOAT + Double DataType = C.TF_DOUBLE + Int32 DataType = C.TF_INT32 + Uint8 DataType = C.TF_UINT8 + Int16 DataType = C.TF_INT16 + Int8 DataType = C.TF_INT8 + String DataType = C.TF_STRING + Complex64 DataType = C.TF_COMPLEX64 + Complex DataType = C.TF_COMPLEX + Int64 DataType = C.TF_INT64 + Bool DataType = C.TF_BOOL + Qint8 DataType = C.TF_QINT8 + Quint8 DataType = C.TF_QUINT8 + Qint32 DataType = C.TF_QINT32 + Bfloat16 DataType = C.TF_BFLOAT16 + Qint16 DataType = C.TF_QINT16 + Quint16 DataType = C.TF_QUINT16 + Uint16 DataType = C.TF_UINT16 + Complex128 DataType = C.TF_COMPLEX128 + Half DataType = C.TF_HALF +) + // Tensor holds a multi-dimensional array of elements of a single data type. type Tensor struct { // We create TF_Tensor on demand rather than keep a handle to C.TF_Tensor |