[PSA] Some Python op constructors will no longer need explicit return types

When βš™ D111811 [mlir][python] Infer result types in generated constructors whenever possible lands, we no longer need to specify inferrable result types to construct operations in Python, similarly to C++. In particular, this applies to most arithmetic ops. See the diff for examples on how to update the callsites.

There is a bunch of operations that use the TypeMatchesWith trait containing a blob of C++ that cannot be used in Python. If those are converted to use InferTypeOpInterface instead, they will get automatically supported by ODS in both C++ and Python.

Some operations, namely MHLO tuple ops, don’t implement the type inference interface even though they could. Same logic applies: implement the interface and get nicer APIs.

2 Likes