Static cast large numbers in gather_operation_test to avoid narrowing conversion failures in MSVC.

PiperOrigin-RevId: 294842856
Change-Id: I9a227100f218e79786509ab8619373efeac664f0
This commit is contained in:
Gunhan Gulsoy 2020-02-12 23:10:20 -08:00 committed by TensorFlower Gardener
parent 17fd546b3f
commit a4f980dc5e

View File

@ -330,8 +330,13 @@ ENTRY main {
)";
Literal operand =
LiteralUtil::CreateR2<int32>({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
Literal start_indices = LiteralUtil::CreateR2<int32>(
{{2, -1}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}});
Literal start_indices =
LiteralUtil::CreateR2<int32>({{2, -1},
{2, 1},
{1, 1},
{-500, 1},
{static_cast<int32>(-2147483648), 1},
{1, 2}});
RunTest(hlo_text, &operand, &start_indices);
}
@ -356,8 +361,13 @@ ENTRY main {
)";
Literal operand =
LiteralUtil::CreateR2<uint32>({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
Literal start_indices = LiteralUtil::CreateR2<int32>(
{{2, -1}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}});
Literal start_indices =
LiteralUtil::CreateR2<int32>({{2, -1},
{2, 1},
{1, 1},
{-500, 1},
{static_cast<int32>(-2147483648), 1},
{1, 2}});
RunTest(hlo_text, &operand, &start_indices);
}