Does output shape contain zero make sense in TE and TIR?

I find the output shape of strided_slice may contain zero, such as [0, 81, 15130], even the inferred type is [1, 81, 15130].

// TIR
// attr [compute(T_strided_slice, body=[T_strided_slice[(ax0 + 1), int64(ax1), int64(ax2)]], axis=[iter_var(ax0, range(min=0, ext=0)), iter_var(ax1, range(min=0, ext=81)), iter_var(ax2, range(min=0, ext=15130))], reduce_axis=[], tag=injective, attrs={})] realize_scope = ""
producer_realize T_strided_slice([0, 0], [0, 81], [0, 15130]) {
  for (ax0, 0, 0) {
    for (ax1, 0, 81) {
      for (ax2, 0, 15130) {
        T_strided_slice[ax0, ax1, ax2] =T_strided_slice[(ax0 + 1), int64(ax1), int64(ax2)]
      }
    }
  }
}
// Relay IR
def @main (%p054: Tensor[(1, 15130, 81), float32], %p149: Tensor[(1, 15130, 1), float32]) -> Tensor[(1, 80, 15130), float32] {
  %4 = fn (%p054: Tensor[(1, 15130, 81), float32], %p149: Tensor[(1, 15130, 1), float32], Primitive=1) -> Tensor[(1, 80, 15130), float32] {
    %0 = divide(%p054, %p149) /* ty=Tensor[(1, 15130, 81), float32] */;
    %1 = transpose(%0, axes=[0, 2, 1]) /* ty=Tensor[(1, 81, 15130), float32] */;
    %2 = strided_slice(%1, begin=[0], end=[9223372036854775807], strides=[1], axes=[0]) /* ty=Tensor[(1, 81, 15130), float32] */;
    %3 = strided_slice(%2, begin=[1], end=[9223372036854775807], strides=[1], axes=[1]) /* ty=Tensor[(1, 80, 15130), float32] */;
    strided_slice(%3, begin=[0], end=[9223372036854775807], strides=[1], axes=[2]) /* ty=Tensor[(1, 80, 15130), float32] */
  };
  %4(%p054, %p149)  /* ty= Tensor[(1, 80, 15130), float32] */
}

Is it make sense?

Interesting, it doesn’t look right.

  • Can you compile this mod and get the correct output?
  • What is the expected shape?

After RemoveNoOp, the body of this fused operator is empty. I think the output shape should be [1, 81, 15130]. But, I don’t test the whole Network yet. I will test it. Thanks. :slight_smile: