From a7a3231e445c4cda4c1a9f3a3a21a26a904afc49 Mon Sep 17 00:00:00 2001 From: Gunhan Gulsoy Date: Wed, 12 Feb 2020 22:07:33 -0800 Subject: [PATCH] Static cast the large literal in scatter_test to avoid narrowing conversion errors when using msvc. PiperOrigin-RevId: 294835705 Change-Id: I59c8bd4b422529c1aba1f9eb8f8fdcbcd415c35d --- tensorflow/compiler/xla/tests/scatter_test.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/xla/tests/scatter_test.cc b/tensorflow/compiler/xla/tests/scatter_test.cc index c7b95f389de..ddd3869d501 100644 --- a/tensorflow/compiler/xla/tests/scatter_test.cc +++ b/tensorflow/compiler/xla/tests/scatter_test.cc @@ -627,8 +627,13 @@ ENTRY main { )"; Literal operand = LiteralUtil::CreateR2({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); - Literal scatter_indices = LiteralUtil::CreateR2( - {{2, 7}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}}); + Literal scatter_indices = + LiteralUtil::CreateR2({{2, 7}, + {2, 1}, + {1, 1}, + {-500, 1}, + {static_cast(-2147483648), 1}, + {1, 2}}); Literal updates = LiteralUtil::CreateR3( {{{10}}, {{20}}, {{30}}, {{40}}, {{50}}, {{60}}}); RunTest(hlo_text, &operand, &scatter_indices, &updates);