aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/go/tensor_test.go
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2016-11-21 11:24:53 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-21 11:44:14 -0800
commitc80be35454a418c18b3fd57614bfcb5265274c33 (patch)
tree975b50379b742f7913eb6d2c14ab8fdfc552d22d /tensorflow/go/tensor_test.go
parent074acf38d83bf4be1e3fe2bb813d4bf32b97c2ac (diff)
Go: Support for String tensors.
And use this support to simplify the Inception example as it can use the DecodeJpeg op. Also fixed a bug in generated op functions - A TensorFlow "int" is a Go "int64". Another step in #10 Change: 139809489
Diffstat (limited to 'tensorflow/go/tensor_test.go')
-rw-r--r--tensorflow/go/tensor_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/go/tensor_test.go b/tensorflow/go/tensor_test.go
index d5f3f74bfd..073da0cc6e 100644
--- a/tensorflow/go/tensor_test.go
+++ b/tensorflow/go/tensor_test.go
@@ -35,8 +35,11 @@ func TestNewTensor(t *testing.T) {
{nil, float64(5)},
{nil, complex(float32(5), float32(6))},
{nil, complex(float64(5), float64(6))},
+ {nil, "a string"},
{[]int64{1}, []float64{1}},
{[]int64{1}, [1]float64{1}},
+ {[]int64{2}, []string{"string", "slice"}},
+ {[]int64{2}, [2]string{"string", "array"}},
{[]int64{3, 2}, [][]float64{{1, 2}, {3, 4}, {5, 6}}},
{[]int64{2, 3}, [2][3]float64{{1, 2, 3}, {3, 4, 6}}},
{[]int64{4, 3, 2}, [][][]float64{
@@ -46,6 +49,11 @@ func TestNewTensor(t *testing.T) {
{{-6, -7}, {-8, -9}, {-10, -11}},
}},
{[]int64{2, 0}, [][]int64{{}, {}}},
+ {[]int64{2, 2}, [][]string{{"row0col0", "row0,col1"}, {"row1col0", "row1,col1"}}},
+ {[]int64{2, 3}, [2][3]string{
+ {"row0col0", "row0,col1", "row0,col2"},
+ {"row1col0", "row1,col1", "row1,col2"},
+ }},
}
var errorTests = []interface{}{