Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request #51138 from yongtang:46911-tile
PiperOrigin-RevId: 397891537
Change-Id: I9b12304000e80dd87e6d4a42614ab10383a967b0
  • Loading branch information
tensorflower-gardener committed Sep 21, 2021
2 parents a5f461b + d9b2759 commit 9294094
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorflow/core/kernels/tile_ops.cc
Expand Up @@ -188,7 +188,8 @@ class TileOp : public OpKernel {
context, multiples_array[i] >= 0,
errors::InvalidArgument("Expected multiples[", i, "] >= 0, but got ",
multiples_array[i]));
output_shape.AddDim(input.dim_size(i) * multiples_array[i]);
OP_REQUIRES_OK(context, output_shape.AddDimWithStatus(
input.dim_size(i) * multiples_array[i]));
}
if (output_shape == input.shape()) {
context->set_output(0, input);
Expand Down
11 changes: 11 additions & 0 deletions tensorflow/python/kernel_tests/shape_ops_test.py
Expand Up @@ -723,6 +723,17 @@ def testShapeFunctionEdgeCases(self):
inp, array_ops.placeholder(
dtypes.int32, shape=[3]))

def testLargeTensor(self):
# Test case for GItHub issue 46911.
if test_util.is_xla_enabled():
# The following test fails with XLA enabled.
return
with self.assertRaises(errors_impl.InternalError):
with self.cached_session():
tiled = array_ops.tile(
np.ones((1, 1, 1)), [100000000, 100000000, 100000000])
self.evaluate(tiled)


if __name__ == "__main__":
test.main()

0 comments on commit 9294094

Please sign in to comment.