- Enables inferring return type for ConstShape, takes into account valid return types;
- The compatible return type function could be reused, leaving that for next use refactoring;
I'm thinking if we need to report error here. It seems to me this is to try to infer the return types, any errors may indicate we can't do that, so that is a failed case. What do you think?
I thinking that do we need to check this or we should have the assumption that it'll be the type we write in ODS? I.e., the size must be 1. Or if we have followed ODS, it's still possible to have size() > 1 case while calling isCompatibleReturnTypes?
In the following check
if (lhs.isa<ShapeType>() || rhs.isa<ShapeType>()) // Shape type is compatible with all other valid return types. return true; auto lhsTensorType = lhs.cast<TensorType>(); auto rhsTensorType = rhs.cast<TensorType>();
We assume if it's not ShapeType then it will be TensorType, this takes the ODS.
Can we use verifyCompatibleShapes?