aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go/tensor.go
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2017-10-10 08:36:23 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-10 08:39:56 -0700
commit3bafe0a86f67dd54197c6d60bdb5053f510de7d8 (patch)
treeb7e9b7fd922f1c5d96ebf04465cfb45154964b4c /tensorflow/go/tensor.go
parent5a26d1ede506825455d1199267d88caeba7d206a (diff)
Add uint32 and uint64 types to TensorFlow.
This change merely creates the types, but does not register kernels that act on uint32/uint64 values. It also does not alter most op registration lists to include uint32/uint64 values. If desirable, that can be done in a subsequent change, although binary size will likely prove problematic if adding more kernels. The intent of the change is so XLA-compiled code can make use uint32/uint64 types. Since XLA does not use traditional TensorFlow kernels, using uint32/uint64 operators from XLA will require only uint32/uint64 op registrations, but will require few new kernel registrations. PiperOrigin-RevId: 171681867
Diffstat (limited to 'tensorflow/go/tensor.go')
-rw-r--r--tensorflow/go/tensor.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/go/tensor.go b/tensorflow/go/tensor.go
index e8fa21a62b..36a74c0081 100644
--- a/tensorflow/go/tensor.go
+++ b/tensorflow/go/tensor.go
@@ -39,6 +39,7 @@ const (
Float DataType = C.TF_FLOAT
Double DataType = C.TF_DOUBLE
Int32 DataType = C.TF_INT32
+ Uint32 DataType = C.TF_UINT32
Uint8 DataType = C.TF_UINT8
Int16 DataType = C.TF_INT16
Int8 DataType = C.TF_INT8
@@ -46,6 +47,7 @@ const (
Complex64 DataType = C.TF_COMPLEX64
Complex DataType = C.TF_COMPLEX
Int64 DataType = C.TF_INT64
+ Uint64 DataType = C.TF_UINT64
Bool DataType = C.TF_BOOL
Qint8 DataType = C.TF_QINT8
Quint8 DataType = C.TF_QUINT8
@@ -217,12 +219,14 @@ var types = []struct {
{reflect.TypeOf(float32(0)), C.TF_FLOAT},
{reflect.TypeOf(float64(0)), C.TF_DOUBLE},
{reflect.TypeOf(int32(0)), C.TF_INT32},
+ {reflect.TypeOf(uint32(0)), C.TF_UINT32},
{reflect.TypeOf(uint8(0)), C.TF_UINT8},
{reflect.TypeOf(int16(0)), C.TF_INT16},
{reflect.TypeOf(int8(0)), C.TF_INT8},
{reflect.TypeOf(""), C.TF_STRING},
{reflect.TypeOf(complex(float32(0), float32(0))), C.TF_COMPLEX64},
{reflect.TypeOf(int64(0)), C.TF_INT64},
+ {reflect.TypeOf(uint64(0)), C.TF_UINT64},
{reflect.TypeOf(false), C.TF_BOOL},
{reflect.TypeOf(uint16(0)), C.TF_UINT16},
{reflect.TypeOf(complex(float64(0), float64(0))), C.TF_COMPLEX128},