HomePhabricator

Generate builder for ops that use InferTypeOpInterface trait in ODS

Authored by jpienaar on Dec 6 2019, 10:52 AM.

Description

Generate builder for ops that use InferTypeOpInterface trait in ODS

For ops with infer type op interface defined, generate version that calls the inferal method on build. This is intermediate step to removing special casing of SameOperandsAndResultType & FirstAttrDereivedResultType. After that would be generating the inference code, with the initial focus on shaped container types. In between I plan to refactor these a bit to reuse generated paths. The intention would not be to add the type inference trait in multiple places, but rather to take advantage of the current modelling in ODS where possible to emit it instead.

Switch the inferReturnTypes method to be static.

Skipping ops with regions here as I don't like the Region vs unique_ptr<Region> difference at the moment, and I want the infer return type trait to be useful for verification too. So instead, just skip it for now to avoid churn.

PiperOrigin-RevId: 284217913

Event Timeline

A. Unique TensorFlower <gardener@tensorflow.org> committed rG398f04aa4910: Generate builder for ops that use InferTypeOpInterface trait in ODS (authored by jpienaar).Dec 6 2019, 10:53 AM