Hi, thanks for your reply! The Python code is as following:
```python
import tvm
from tvm import auto_scheduler, te, topi


@auto_scheduler.register_workload
def double_reshape(n: int, c: int, h: int, w: int):
    X = te.placeholder((n, c, h, w))
    Y = topi.reshape(X, (n, 1, c, h, w))
    Z = topi.reshape(Y, (n, c, h, w))
    return [X, Z]


if __name__ == '__main__':
    target = tvm.target.Target(target='llvm', host='llvm')
    task = auto_scheduler.SearchTask(func=double_reshape, args=(32, 3, 32, 32), 
target=target)
    print(task.compute_dag)
    tune_options = auto_scheduler.TuningOptions(
        num_measure_trials=256,
        num_measures_per_round=64,
        verbose=2,
    )
    task.tune(tune_options)
```

The `compute_dag` is like:
```
placeholder = PLACEHOLDER [32, 3, 32, 32]
T_reshape(ax0, ax1, ax2, ax3, ax4) = 
placeholder[floormod(floordiv(floordiv(floordiv((((((((ax0 + ax1)*3) + ax2)*32) 
+ ax3)*32)  ..(OMITTED).. iv((((((((ax0 + ax1)*3) + ax2)*32) + ax3)*32) + ax4), 
32), 32), floormod((((((((ax0 + ax1)*3) + ax2)*32) + ax3)*32) + ax4), 32)]
T_reshape(ax0, ax1, ax2, ax3) = 
T_reshape[floormod(floordiv(floordiv(floordiv(((((((ax0*3) + ax1)*32) + 
ax2)*32) + ax3), 32), 32 ..(OMITTED)..  floormod(floordiv(((((((ax0*3) + 
ax1)*32) + ax2)*32) + ax3), 32), 32), floormod(((((((ax0*3) + ax1)*32) + 
ax2)*32) + ax3), 32)]
```
And all searched schedules have two reshape in the code, without eliminating 
the first reshape.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/autoscheduler-how-to-enable-optimization-passes-for-autoscheduler/12195/3)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/96d91bed6309de9959aa590211caf5c0eedeb3ad292841eacfbb243995429359).

Reply via email to