jiazhihao / TASO

The Tensor Algebra SuperOptimizer for Deep Learning
Apache License 2.0
687 stars 90 forks source link

AssertionError: Unsupported ONNX operator: StridedSlice #12

Closed OuHangKresnik closed 4 years ago

OuHangKresnik commented 4 years ago

Just as this error shows

OuHangKresnik commented 4 years ago

I just checked the implementation of this operator in tensorflow, https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/strided_slice.cc

the logic looks more complex than it should be.

I will try to replace this operator with constant, while since there are dozens of them (maybe one hundred), I don't know whether this would work. Another thing is, this operator contains lots of 0 dim output. As long as TASO support 0-dim, then shouldn't be a blocker

OuHangKresnik commented 4 years ago

Actually 2 situations:

  1. a dimension with size 0
  2. dimension size == 0

These 2 are different.

OuHangKresnik commented 4 years ago

It's just very hard to replace this op with constant, since there are hundreds of them and need to replace both shape and value. (If value only, the following operators would result in wrong shapes)

When I tried to dump the real value, there is a bug from tensorflow DebugString() which causes segmentation fault