Samsung / ONE

On-device Neural Engine
Other
427 stars 152 forks source link

Compiler FE: ZerosLike with different output type #970

Open seanshpark opened 4 years ago

seanshpark commented 4 years ago

From https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/zeros_like,

Optionally, you can use dtype to specify a new type for the returned tensor.

Lets find a way to support this in luci

seanshpark commented 4 years ago

Related #964

seanshpark commented 4 years ago

While in GraphBuild step, output tensor dtype is set to the IR Node . We can simply return dtype of the Node in type inference.

seanshpark commented 4 years ago

Question; do we still need TypeInference?

s-barannikov commented 4 years ago

Question; do we still need TypeInference?

IMHO we don't, but it could be transformed into TypeChecker. There was another opinion, that TypeInference could be helpful after optimization passes which do not set dtype properly. IMHO those optimizations should be fixed to set dtype (and verify that fact with TypeChecker).

seanshpark commented 4 years ago

TypeInference could be helpful after optimization passes which do not set dtype properly

Ah.. thanks for reminding me :)