Remove duplicate error check in RESHAPE.
PiperOrigin-RevId: 296095268 Change-Id: I22c50cf2fb8cb1343c8c99f9cf557aad45aff15c
This commit is contained in:
parent
7ad1eb110f
commit
dea81b04c3
@ -38,14 +38,11 @@ class Reshape : public NodeShader {
|
||||
auto output = ctx.graph->FindOutputs(ctx.node->id)[0];
|
||||
if (input->tensor.shape.DimensionsProduct() !=
|
||||
output->tensor.shape.DimensionsProduct()) {
|
||||
return InvalidArgumentError("Dimensions product is reshape don't match");
|
||||
return InvalidArgumentError(
|
||||
"Number of elements in input & output tensors don't match.");
|
||||
}
|
||||
auto attr =
|
||||
absl::any_cast<ReshapeAttributes>(ctx.node->operation.attributes);
|
||||
if (input->tensor.shape.DimensionsProduct() !=
|
||||
output->tensor.shape.DimensionsProduct()) {
|
||||
return InvalidArgumentError("Dimensions product is reshape don't match");
|
||||
}
|
||||
if (attr.new_shape != output->tensor.shape) {
|
||||
return InvalidArgumentError(
|
||||
"Dimensions for output does not match new_shape attribute");
|
||||
|
Loading…
Reference in New Issue
Block a user