From a4f980dc5eb60333ecb855f6a7f44528ccf2f9a9 Mon Sep 17 00:00:00 2001 From: Gunhan Gulsoy Date: Wed, 12 Feb 2020 23:10:20 -0800 Subject: [PATCH] Static cast large numbers in gather_operation_test to avoid narrowing conversion failures in MSVC. PiperOrigin-RevId: 294842856 Change-Id: I9a227100f218e79786509ab8619373efeac664f0 --- .../xla/tests/gather_operation_test.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tensorflow/compiler/xla/tests/gather_operation_test.cc b/tensorflow/compiler/xla/tests/gather_operation_test.cc index 71090077ae8..9bba59787a1 100644 --- a/tensorflow/compiler/xla/tests/gather_operation_test.cc +++ b/tensorflow/compiler/xla/tests/gather_operation_test.cc @@ -330,8 +330,13 @@ ENTRY main { )"; Literal operand = LiteralUtil::CreateR2({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); - Literal start_indices = LiteralUtil::CreateR2( - {{2, -1}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}}); + Literal start_indices = + LiteralUtil::CreateR2({{2, -1}, + {2, 1}, + {1, 1}, + {-500, 1}, + {static_cast(-2147483648), 1}, + {1, 2}}); RunTest(hlo_text, &operand, &start_indices); } @@ -356,8 +361,13 @@ ENTRY main { )"; Literal operand = LiteralUtil::CreateR2({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}); - Literal start_indices = LiteralUtil::CreateR2( - {{2, -1}, {2, 1}, {1, 1}, {-500, 1}, {-2147483648, 1}, {1, 2}}); + Literal start_indices = + LiteralUtil::CreateR2({{2, -1}, + {2, 1}, + {1, 1}, + {-500, 1}, + {static_cast(-2147483648), 1}, + {1, 2}}); RunTest(hlo_text, &operand, &start_indices); }