tensorflow/compiler/tf2xla/xla_op_registry_test.cc
// Test the correctness of registered kernels. The kernel registered for CPU
// should have type INT32 while all other kernels should have type FLOAT.
Test the correctness of registered kernels. The kernel registered for CPU
should have type INT32 while all other kernels should have type FLOAT.
Test the correctness of registered kernels . The kernel registered for CPU should have type INT32 while all other kernels should have type FLOAT .
TEST(XlaOpRegistryTest, XlaOpRegistrationWithOverride) {
  XlaOpRegistry::RegisterCompilationKernels();
  auto registered_kernels = GetAllRegisteredKernels().kernel();
  for (const auto& kernels : registered_kernels) {
    if (kernels.op() == "DummyDuplicateOp") {
      EXPECT_EQ(kernels.constraint_size(), 1);
      EXPECT_EQ(kernels.constraint(0).name(), "T");
      if (kernels.device_type() == "XLA_CPU_JIT") {
        EXPECT_EQ(kernels.constraint(0).allowed_values().list().type(0),
                  DT_INT32);
      } else {
        EXPECT_EQ(kernels.constraint(0).allowed_values().list().type(0),
                  DT_FLOAT);
      }
    }
  }
}
TEST ( XlaOpRegistryTest , XlaOpRegistrationWithOverride ) { XlaOpRegistry :: RegisterCompilationKernels ( ) ; auto registered_kernels = GetAllRegisteredKernels ( ) . kernel ( ) ; for ( const auto & kernels : registered_kernels ) { if ( kernels . op ( ) == " " ) { EXPECT_EQ ( kernels . constraint_size ( ) , 1 ) ; EXPECT_EQ ( kernels . constraint ( 0 ) . name ( ) , " " ) ; if ( kernels . device_type ( ) == " " ) { EXPECT_EQ ( kernels . constraint ( 0 ) . allowed_values ( ) . list ( ) . type ( 0 ) , DT_INT32 ) ; } else { EXPECT_EQ ( kernels . constraint ( 0 ) . allowed_values ( ) . list ( ) . type ( 0 ) , DT_FLOAT ) ; } } } }
Test the correctness of registered kernels.
Test the correctness of registered kernels .