提交 f7ca8db7 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

[XLA] Improve shape inference error messages for DynamicSlice/DynamicUpdateSlice.

PiperOrigin-RevId: 157461335
上级 8c2a079e
......@@ -1087,9 +1087,11 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
const int64 start_num_dims = start_indices_shape.dimensions(0);
if (ShapeUtil::Rank(operand_shape) != start_num_dims) {
return InvalidArgument(
"dynamic slice start number of dimensions %lld must match rank %lld of "
"slice input",
start_num_dims, ShapeUtil::Rank(operand_shape));
"dynamic slice start number of dimensions %lld (%s) must match rank "
"%lld of slice input (%s)",
start_num_dims, ShapeUtil::HumanString(start_indices_shape).c_str(),
ShapeUtil::Rank(operand_shape),
ShapeUtil::HumanString(operand_shape).c_str());
}
if (slice_sizes.size() != ShapeUtil::Rank(operand_shape)) {
......@@ -1148,9 +1150,11 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
const int64 start_num_dims = start_indices_shape.dimensions(0);
if (ShapeUtil::Rank(operand_shape) != start_num_dims) {
return InvalidArgument(
"dynamic update slice start number of dimensions %lld must match "
"rank %lld of slice input",
start_num_dims, ShapeUtil::Rank(operand_shape));
"dynamic slice start number of dimensions %lld (%s) must match rank "
"%lld of slice input (%s)",
start_num_dims, ShapeUtil::HumanString(start_indices_shape).c_str(),
ShapeUtil::Rank(operand_shape),
ShapeUtil::HumanString(operand_shape).c_str());
}
if (ShapeUtil::Rank(update_shape) != ShapeUtil::Rank(operand_shape)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册