Samsung / ONE

On-device Neural Engine
Other
435 stars 157 forks source link

[compiler] Support Shape Inference for determined by input data #14095

Open icodo98 opened 1 month ago

icodo98 commented 1 month ago

What

Let's support Shape Inference for determined by input data

Why

There are some operations(ex. Reshape, Pad) which determine output shape by input tensor data. Current ShapeInference only allows access to input data when input is CircleConst. It leaves output shape unknown or stop inferencing when input is CircleNode instead CircleConst. However, there are some operations (ex. PACK) that determines output data in compile time. Maybe we can inference output shape for these cases.

icodo98 commented 1 month ago

It leaves output shape unknown or stop inferencing when input is CircleNode instead CircleConst.

With principal above, .opt.circle is different from .tflite in YamNet

image

After ShapeInferencePass output shape of Reshape will be [?, ?, ?, ?].