Automated g4 rollback of changelist 186494344
authorJacques Pienaar <jpienaar@google.com>
Wed, 21 Feb 2018 23:37:05 +0000 (15:37 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 21 Feb 2018 23:44:58 +0000 (15:44 -0800)
PiperOrigin-RevId: 186530782

tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc
tensorflow/compiler/xla/tests/convert_test.cc
tensorflow/compiler/xla/tests/scalar_computations_test.cc

index 8b35259..739d201 100644 (file)
@@ -101,33 +101,6 @@ XLA_TEST_F(ArrayElementwiseOpTest, NegConstantC64) {
       {}, error_spec_);
 }
 
-XLA_TEST_F(ArrayElementwiseOpTest, NegConstantS64) {
-  ComputationBuilder builder(client_, TestName());
-  auto a = builder.ConstantR1<int64>({
-      -1,
-      1,
-      0,
-      0x12345678,
-      static_cast<int64>(0xffffffff12345678l),
-      static_cast<int64>(0x8000000000000000LL),
-      static_cast<int64>(0x8000000000000001LL),
-  });
-  auto result = builder.Neg(a);
-  LOG(INFO) << -static_cast<int64>(0x7FFFFFFFFFFFFFFFLL);
-
-  ComputeAndCompareR1<int64>(&builder,
-                             {
-                                 1,
-                                 -1,
-                                 0,
-                                 -0x12345678,
-                                 0xedcba988,
-                                 static_cast<int64>(0x8000000000000000LL),
-                                 -static_cast<int64>(0x8000000000000001LL),
-                             },
-                             {});
-}
-
 XLA_TEST_F(ArrayElementwiseOpTest, IsFiniteZeroElementF32s) {
   ComputationBuilder builder(client_, TestName());
   auto a = builder.ConstantR1<float>({});
@@ -213,86 +186,6 @@ XLA_TEST_F(ArrayElementwiseOpTest, AddTwoConstantZeroElementC64s) {
   ComputeAndCompareR1<complex64>(&builder, {}, {}, error_spec_);
 }
 
-XLA_TEST_F(ArrayElementwiseOpTest, AddTwoConstantU64s) {
-  ComputationBuilder b(client_, TestName());
-
-  std::vector<uint64> lhs{0xFFFFFFFF,
-                          static_cast<uint64>(-1),
-                          0,
-                          0,
-                          0x7FFFFFFFFFFFFFFFLL,
-                          0x7FFFFFFFFFFFFFFLL,
-                          0x8000000000000000LL,
-                          0x8000000000000000LL,
-                          1};
-  std::unique_ptr<Literal> lhs_literal = Literal::CreateR1<uint64>({lhs});
-  auto lhs_param = b.Parameter(0, lhs_literal->shape(), "lhs_param");
-  std::unique_ptr<GlobalData> lhs_data =
-      client_->TransferToServer(*lhs_literal).ConsumeValueOrDie();
-
-  std::vector<uint64> rhs{1,
-                          0x7FFFFFFFFFFFFFFLL,
-                          0x7FFFFFFFFFFFFFFFLL,
-                          0x8000000000000000LL,
-                          0,
-                          static_cast<uint64>(-1),
-                          0,
-                          1,
-                          0x8000000000000000LL};
-  std::unique_ptr<Literal> rhs_literal = Literal::CreateR1<uint64>({rhs});
-  auto rhs_param = b.Parameter(1, rhs_literal->shape(), "rhs_param");
-  std::unique_ptr<GlobalData> rhs_data =
-      client_->TransferToServer(*rhs_literal).ConsumeValueOrDie();
-
-  auto add = b.Add(lhs_param, rhs_param);
-
-  std::vector<uint64> expected(lhs.size());
-  for (int64 i = 0; i < lhs.size(); ++i) {
-    expected[i] = lhs[i] + rhs[i];
-  }
-
-  ComputeAndCompareR1<uint64>(&b, expected, {lhs_data.get(), rhs_data.get()});
-}
-
-XLA_TEST_F(ArrayElementwiseOpTest, SubTwoConstantS64s) {
-  ComputationBuilder b(client_, TestName());
-
-  std::vector<int64> lhs{static_cast<int64>(0x8000000000000000LL),
-                         static_cast<int64>(0x8000000000000000LL),
-                         -1,
-                         0x7FFFFFFFFFFFFFFLL,
-                         0x7FFFFFFFFFFFFFFFLL,
-                         1,
-                         0,
-                         -1};
-  std::unique_ptr<Literal> lhs_literal = Literal::CreateR1<int64>({lhs});
-  auto lhs_param = b.Parameter(0, lhs_literal->shape(), "lhs_param");
-  std::unique_ptr<GlobalData> lhs_data =
-      client_->TransferToServer(*lhs_literal).ConsumeValueOrDie();
-
-  std::vector<int64> rhs{-1,
-                         0,
-                         static_cast<int64>(0x8000000000000000LL),
-                         1,
-                         0,
-                         0x7FFFFFFFFFFFFFFLL,
-                         0x7FFFFFFFFFFFFFFFLL,
-                         0x7FFFFFFFFFFFFFFFLL};
-  std::unique_ptr<Literal> rhs_literal = Literal::CreateR1<int64>({rhs});
-  auto rhs_param = b.Parameter(1, rhs_literal->shape(), "rhs_param");
-  std::unique_ptr<GlobalData> rhs_data =
-      client_->TransferToServer(*rhs_literal).ConsumeValueOrDie();
-
-  auto sub = b.Sub(lhs_param, rhs_param);
-
-  std::vector<int64> expected(lhs.size());
-  for (int64 i = 0; i < lhs.size(); ++i) {
-    expected[i] = lhs[i] - rhs[i];
-  }
-
-  ComputeAndCompareR1<int64>(&b, expected, {lhs_data.get(), rhs_data.get()});
-}
-
 TEST_P(ArrayElementwiseOpTestParamCount, AddManyValues) {
   const int count = GetParam();
   ComputationBuilder builder(client_, TestName());
index f4f9f28..1c6e785 100644 (file)
@@ -107,73 +107,11 @@ TEST_F(ConvertTest, ConvertR1F32ToR1S32) {
 
 XLA_TEST_F(ConvertTest, ConvertR1S64ToR1F32) {
   ComputationBuilder builder(client_, TestName());
-  std::vector<int64> arg{
-      -9223371216516022272,
-      -2,
-      -1,
-      -0x7FFFFFFF,
-      -0x80000000,
-      0,
-      1,
-      2,
-      1073742145,
-      1073742656,
-      0x7FFFFFFF,
-      0x80000000,
-      826720496944058148,
-      4296062029846194332,
-      0x0007FB72E4000000LL,
-      0x0007FB72E4000001LL,
-      0x0007FB72E6000000LL,
-      0x0007FB72E7000000LL,
-      0x0007FB72E7FFFFFFLL,
-      0x0007FB72E8000000LL,
-      0x0007FB72E8000001LL,
-      0x0007FB72EA000000LL,
-      0x0007FB72EB000000LL,
-      0x0007FB72EBFFFFFFLL,
-      0x0007FB72EC000000LL,
-      0x7FFFFF0000000000LL,
-      0x7FFFFF8000000000LL,
-      0x7FFFFFFFFFFFFF00,
-      static_cast<int64>(0xFFFFFFFFFFFFFFFF),
-      static_cast<int64>(0x0000f234e67e0001LL),
-      static_cast<int64>(0x8000000000000000),
-      static_cast<int64>(0x8000000000000000LL),
-      static_cast<int64>(0x8000000000000001LL),
-      static_cast<int64>(0x8000008000000000LL),
-      static_cast<int64>(0x8000010000000000LL),
-  };
-  std::unique_ptr<Literal> arg_literal = Literal::CreateR1<int64>({arg});
-  auto arg_param = builder.Parameter(0, arg_literal->shape(), "arg_param");
-  std::unique_ptr<GlobalData> arg_data =
-      client_->TransferToServer(*arg_literal).ConsumeValueOrDie();
-
-  builder.ConvertElementType(arg_param, F32);
-
-  std::vector<float> expected(arg.size());
-  for (int64 i = 0; i < arg.size(); ++i) {
-    expected[i] = static_cast<float>(arg[i]);
-  }
-  ComputeAndCompareR1<float>(&builder, expected, {arg_data.get()});
-}
+  auto a = builder.ConstantR1<int64>({32, 64});
+  builder.ConvertElementType(a, F32);
 
-XLA_TEST_F(ConvertTest, ConvertR1U32ToR1F32) {
-  ComputationBuilder builder(client_, TestName());
-  std::vector<uint32> arg{0,          1,          0x1000,     0x7fffffff,
-                          0x80000000, 0x80000001, 0x80000002, 0xFFFFFFFF};
-  std::unique_ptr<Literal> arg_literal = Literal::CreateR1<uint32>({arg});
-  auto arg_param = builder.Parameter(0, arg_literal->shape(), "arg_param");
-  std::unique_ptr<GlobalData> arg_data =
-      client_->TransferToServer(*arg_literal).ConsumeValueOrDie();
-
-  builder.ConvertElementType(arg_param, F32);
-
-  std::vector<float> expected(arg.size());
-  for (int64 i = 0; i < arg.size(); ++i) {
-    expected[i] = static_cast<float>(arg[i]);
-  }
-  ComputeAndCompareR1<float>(&builder, expected, {arg_data.get()});
+  std::vector<float> expected = {32.0, 64.0};
+  ComputeAndCompareR1<float>(&builder, expected, {});
 }
 
 XLA_TEST_F(ConvertTest, ConvertR1U8ToR1F32) {
index d7bda77..4da6ee9 100644 (file)
@@ -163,7 +163,7 @@ XLA_TEST_F(ScalarComputationsTest, CastS64ToF32) {
   auto a = builder.Parameter(0, ShapeUtil::MakeShape(S64, {}), "a");
   builder.ConvertElementType(a, F32);
 
-  int64 value = 3LL << 35;
+  int64 value = 3LL << 32;
   std::unique_ptr<Literal> a_literal = Literal::CreateR0<int64>(value);
   std::unique_ptr<GlobalData> a_data =
       client_->TransferToServer(*a_literal).ConsumeValueOrDie();