From c799bd996e9c988d922715be4a3d7f217424f714 Mon Sep 17 00:00:00 2001 From: tg-at-google Date: Fri, 5 Jun 2020 08:56:29 -0400 Subject: [PATCH] Update tensor_shape.cc --- tensorflow/core/framework/tensor_shape.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/core/framework/tensor_shape.cc b/tensorflow/core/framework/tensor_shape.cc index 79d0cc0822d..8040a316a45 100644 --- a/tensorflow/core/framework/tensor_shape.cc +++ b/tensorflow/core/framework/tensor_shape.cc @@ -182,12 +182,12 @@ void TensorShapeBase::InitDims(gtl::ArraySlice dim_sizes) { // Allow sizes that are under kint64max^0.25 so that 4-way multiplication // below cannot overflow. - static const uint64 kMaxSmall = 0xd744; + static const int64 kMaxSmall = 0xd744; static_assert(kMaxSmall * kMaxSmall * kMaxSmall * kMaxSmall <= kint64max, "bad overflow check"); bool large_size = false; for (auto s : dim_sizes) { - if (static_cast(s) > static_cast(kMaxSmall)) { + if (s > kMaxSmall) { large_size = true; break; }