[XLA] Improve shape inference error messages for DynamicSlice/DynamicUpdateSlice.
PiperOrigin-RevId: 157461335
This commit is contained in:
parent
8c2a079ec8
commit
f7ca8db7d8
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user