diff options
author | 2016-01-26 15:58:29 -0800 | |
---|---|---|
committer | 2016-01-26 16:24:58 -0800 | |
commit | d33346a801181cb601a4cfc95f1087e165b19703 (patch) | |
tree | 43faaa69ae419aff56c0fc836b98d5538bc9da46 /tensorflow/core/framework/tensor_shape_test.cc | |
parent | cfb27ca4c2c4dbbf27726a3bc4d72bb6f8865319 (diff) |
TensorFlow: fix bug in TensorShapeDim -- size is the wrong type.
Adds a test that failed before this change, but passes after.
TensorShapeIter is only used by TensorShape::begin() and end(),
which are only used by AppendShape, which is only used by queue_base.h
on shapes that are unlikely to be 64-bit large, which is why
we never triggered this.
Discovered by jeff
Change: 113105906
Diffstat (limited to 'tensorflow/core/framework/tensor_shape_test.cc')
-rw-r--r-- | tensorflow/core/framework/tensor_shape_test.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tensorflow/core/framework/tensor_shape_test.cc b/tensorflow/core/framework/tensor_shape_test.cc index ad9a9074b2..a4424f7f29 100644 --- a/tensorflow/core/framework/tensor_shape_test.cc +++ b/tensorflow/core/framework/tensor_shape_test.cc @@ -86,5 +86,17 @@ TEST(TensorShapeTest, SetDimForEmptyTensor) { EXPECT_EQ(1400, s.num_elements()); } +TEST(TensorShapeTest, AppendShape64BitIndices) { + TensorShape s({10, 2147483648}); + + EXPECT_EQ(10, s.dim_size(0)); + EXPECT_EQ(2147483648, s.dim_size(1)); + + TensorShape s2; + s2.AppendShape(s); + EXPECT_EQ(10, s2.dim_size(0)); + EXPECT_EQ(2147483648, s2.dim_size(1)); +} + } // namespace } // namespace tensorflow |