Static cast the large literal in scatter_test to avoid narrowing conversion errors when using msvc.

PiperOrigin-RevId: 294835705
Change-Id: I59c8bd4b422529c1aba1f9eb8f8fdcbcd415c35d
This commit is contained in:
Gunhan Gulsoy 2020-02-12 22:07:33 -08:00 committed by TensorFlower Gardener
parent 7cdd88eb94
commit a7a3231e44

View File

@ -627,8 +627,13 @@ ENTRY main {
)";
Literal operand =
LiteralUtil::CreateR2<int32>({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
Literal scatter_indices = LiteralUtil::CreateR2<int32>(
{{2, 7}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}});
Literal scatter_indices =
LiteralUtil::CreateR2<int32>({{2, 7},
{2, 1},
{1, 1},
{-500, 1},
{static_cast<int32>(-2147483648), 1},
{1, 2}});
Literal updates = LiteralUtil::CreateR3<int32>(
{{{10}}, {{20}}, {{30}}, {{40}}, {{50}}, {{60}}});
RunTest(hlo_text, &operand, &scatter_indices, &updates);