aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/tests/test_utils.cc
diff options
context:
space:
mode:
authorGravatar Nick Desaulniers <ndesaulniers@google.com>2018-01-03 14:19:25 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-03 14:22:53 -0800
commit4ffecfecb3ba21645710d138150282f26f190d2a (patch)
tree4838da934a5d71cc5fc18ccd0766977354f3529a /tensorflow/compiler/xla/tests/test_utils.cc
parentfaa62132751f8f4ddbcdf24bb2db4146ee0e69c1 (diff)
[XLA] Remove a false invariant used in generating test inputs.
This invariant is incorrect; the parameter will never be the shape of the use's first operand; in fact the param should match operand(1)'s shape for DynamicSlice and operand(2)'s shape for DynamicUpdateSlice (since start_indices is the argument that we are trying to constrain the bounds for). This is checked for in CreateLiteralForConstrainedUses(). PiperOrigin-RevId: 180717508
Diffstat (limited to 'tensorflow/compiler/xla/tests/test_utils.cc')
-rw-r--r--tensorflow/compiler/xla/tests/test_utils.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/tests/test_utils.cc b/tensorflow/compiler/xla/tests/test_utils.cc
index f9c62ec217..e8a05cf2b8 100644
--- a/tensorflow/compiler/xla/tests/test_utils.cc
+++ b/tensorflow/compiler/xla/tests/test_utils.cc
@@ -145,7 +145,6 @@ StatusOr<std::unique_ptr<Literal>> CreateLiteralForConstrainedUses(
switch (use->opcode()) {
case HloOpcode::kDynamicSlice:
case HloOpcode::kDynamicUpdateSlice:
- TF_RET_CHECK(ShapeUtil::Equal(param.shape(), use->operand(0)->shape()));
if (needs_index != nullptr &&
!ShapeUtil::Equal(needs_index->shape(), use->shape())) {
return Unimplemented(
@@ -173,7 +172,8 @@ StatusOr<std::unique_ptr<Literal>> CreateLiteralForConstrainedUses(
needs_index->ToString().c_str(), needs_zero->ToString().c_str());
}
if (needs_index != nullptr) {
- return MakeRandomNonwrappingSliceIndex(param.shape(), needs_index->shape());
+ return MakeRandomNonwrappingSliceIndex(needs_index->operand(0)->shape(),
+ needs_index->shape());
} else if (needs_zero != nullptr) {
return Literal::CreateFromShape(param.shape());
} else {