aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_sharding_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-03-23 03:55:03 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-23 03:57:30 -0700
commit9d77ea7b9568373047b10701576c1234f15bf093 (patch)
tree2e76c92a20f8131ac7f9bd1b890f937a38128fc1 /tensorflow/compiler/xla/service/hlo_sharding_test.cc
parenta3f27a5898a3c1b28e6a3fb2e6e6bd75644c522e (diff)
Implement operator<< for HloSharding
The new operator makes the error messages coming from gtest more readable as well as making logging easier. PiperOrigin-RevId: 190200926
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_sharding_test.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_sharding_test.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_sharding_test.cc b/tensorflow/compiler/xla/service/hlo_sharding_test.cc
index 07fc4687cc..9887096eb5 100644
--- a/tensorflow/compiler/xla/service/hlo_sharding_test.cc
+++ b/tensorflow/compiler/xla/service/hlo_sharding_test.cc
@@ -282,5 +282,14 @@ TEST_F(HloShardingTest, TransformShardedTileShapeTest) {
EXPECT_EQ(result, expected);
}
+TEST_F(HloShardingTest, OstreamTest) {
+ HloSharding sharding =
+ HloSharding::Tile(ShapeUtil::MakeShape(F32, {3, 5, 7, 11}),
+ Array4D<int64>({{{{0, 1}, {2, 3}}}}));
+ std::ostringstream oss;
+ oss << sharding;
+ EXPECT_EQ(oss.str(), "{f32[3,5,7,11] devices=(0, 1, 2, 3)}");
+}
+
} // namespace
} // namespace xla