Change cast to dyn_cast in hlo::ReshapeOp's verification.
With cast, a failing verification results in an assertion error rather than returning a failing status. PiperOrigin-RevId: 322317937
This commit is contained in:
parent
c23ad602c8
commit
63d62b7952
|
@ -1468,7 +1468,7 @@ static LogicalResult Verify(PadOp op) {
|
|||
|
||||
static LogicalResult Verify(ReshapeOp op) {
|
||||
// If the operand type is dynamically shaped there is nothing to verify.
|
||||
auto operand_ty = op.operand().getType().cast<RankedTensorType>();
|
||||
auto operand_ty = op.operand().getType().dyn_cast<RankedTensorType>();
|
||||
if (!operand_ty || !operand_ty.hasStaticShape()) return success();
|
||||
|
||||
// If the operand type is statically shaped (not required) the number of
|
||||
|
|
Loading…
Reference in New Issue