HomePhabricator

Add compatible query method to infer type interface

Authored by jpienaar on Nov 7 2019, 7:51 AM.

Description

Add compatible query method to infer type interface

A return type that differs from the inferred return type need not indicate that an operation is invalid (e.g., tensor<*xf32> vs tensor<10xf32>) but they should be compatible for the operation to be considered valid. Add method to query if inferred type is compatible with return type.

Also add InferTypeOpIntefaceDefault trait that considers equality and compatibility as the same. Currently an op has to opt in to using it explicitly.

PiperOrigin-RevId: 279085639

Details

Committed
A. Unique TensorFlower <gardener@tensorflow.org>Nov 7 2019, 7:51 AM
Parents
rG72040bf7c8f2: Update Linalg to use std.view
Branches
Unknown
Tags
Unknown

Event Timeline

A. Unique TensorFlower <gardener@tensorflow.org> committed rG7af61f6bcd4f: Add compatible query method to infer type interface (authored by jpienaar).Nov 7 2019, 7:51 AM