aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/token_hlo_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/tests/token_hlo_test.cc')
-rw-r--r--tensorflow/compiler/xla/tests/token_hlo_test.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/tensorflow/compiler/xla/tests/token_hlo_test.cc b/tensorflow/compiler/xla/tests/token_hlo_test.cc
index e9008fa48a..2bdbd08309 100644
--- a/tensorflow/compiler/xla/tests/token_hlo_test.cc
+++ b/tensorflow/compiler/xla/tests/token_hlo_test.cc
@@ -31,21 +31,21 @@ class TokenHloTest : public HloTestBase {};
XLA_TEST_F(TokenHloTest, SingleTokenInstruction) {
std::unique_ptr<HloModule> module = CreateNewModule();
auto builder = HloComputation::Builder(TestName());
- builder.AddInstruction(HloInstruction::CreateAfterAll({}));
+ builder.AddInstruction(HloInstruction::CreateToken());
module->AddEntryComputation(builder.Build());
TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> result,
Execute(std::move(module), {}));
- EXPECT_TRUE(LiteralTestUtil::Equal(*result, *Literal::CreateToken()));
+ EXPECT_TRUE(LiteralTestUtil::Equal(*result, *LiteralUtil::CreateToken()));
}
XLA_TEST_F(TokenHloTest, TokenTree) {
std::unique_ptr<HloModule> module = CreateNewModule();
auto builder = HloComputation::Builder(TestName());
- auto token0 = builder.AddInstruction(HloInstruction::CreateAfterAll({}));
- auto token1 = builder.AddInstruction(HloInstruction::CreateAfterAll({}));
- auto token2 = builder.AddInstruction(HloInstruction::CreateAfterAll({}));
+ auto token0 = builder.AddInstruction(HloInstruction::CreateToken());
+ auto token1 = builder.AddInstruction(HloInstruction::CreateToken());
+ auto token2 = builder.AddInstruction(HloInstruction::CreateToken());
builder.AddInstruction(
HloInstruction::CreateAfterAll({token0, token0, token1, token2}));
@@ -53,7 +53,7 @@ XLA_TEST_F(TokenHloTest, TokenTree) {
TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> result,
Execute(std::move(module), {}));
- EXPECT_TRUE(LiteralTestUtil::Equal(*result, *Literal::CreateToken()));
+ EXPECT_TRUE(LiteralTestUtil::Equal(*result, *LiteralUtil::CreateToken()));
}
XLA_TEST_F(TokenHloTest, InvalidTokenShapedEntryParameter) {
@@ -64,7 +64,7 @@ XLA_TEST_F(TokenHloTest, InvalidTokenShapedEntryParameter) {
builder.AddInstruction(
HloInstruction::CreateParameter(1, ShapeUtil::MakeTokenShape(), "p1"));
builder.AddInstruction(
- HloInstruction::CreateConstant(Literal::CreateR0<int32>(42)));
+ HloInstruction::CreateConstant(LiteralUtil::CreateR0<int32>(42)));
module->AddEntryComputation(builder.Build());
Status status = HloVerifier().Run(module.get()).status();
@@ -98,7 +98,7 @@ XLA_TEST_F(TokenHloTest, InvalidOperandToTokenInstruction) {
HloInstruction::CreateParameter(0, ShapeUtil::MakeShape(F32, {}), "p0"));
builder.AddInstruction(HloInstruction::CreateAfterAll({param}));
builder.AddInstruction(
- HloInstruction::CreateConstant(Literal::CreateR0<int32>(123)));
+ HloInstruction::CreateConstant(LiteralUtil::CreateR0<int32>(123)));
module->AddEntryComputation(builder.Build());
Status status = HloVerifier().Run(module.get()).status();
@@ -184,7 +184,7 @@ ENTRY %TokenInConditional (param.3: pred[]) -> s32[] {
TF_ASSERT_OK_AND_ASSIGN(
std::unique_ptr<HloModule> module,
HloRunner::CreateModuleFromString(module_string, debug_options));
- auto arg = Literal::CreateR0<bool>(true);
+ auto arg = LiteralUtil::CreateR0<bool>(true);
TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> result,
Execute(std::move(module), {arg.get()}));
EXPECT_EQ(42, result->Get<int32>({}));
@@ -195,7 +195,7 @@ ENTRY %TokenInConditional (param.3: pred[]) -> s32[] {
TF_ASSERT_OK_AND_ASSIGN(
std::unique_ptr<HloModule> module,
HloRunner::CreateModuleFromString(module_string, debug_options));
- auto arg = Literal::CreateR0<bool>(false);
+ auto arg = LiteralUtil::CreateR0<bool>(false);
TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Literal> result,
Execute(std::move(module), {arg.get()}));
EXPECT_EQ(7, result->Get<int32>({}));