You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Ziheng Jiang via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/09/29 08:20:36 UTC
[Apache TVM Discuss] [Development/RFC] [RFC] Hybrid Script Support
for TIR
Nice work @spectrometerHBH!
I would like to give it a try! One question, how can I build the `tir.function` after I define it with the script? Is the path has been pushed on master branch now?
---
[Visit Topic](https://discuss.tvm.apache.org/t/rfc-hybrid-script-support-for-tir/7516/21) 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/b50373a09b03dda89c17f9aa6fb1b8c7be47d626edb29bc3bea1359b519677eb).
[Apache TVM Discuss] [Development/RFC] [RFC] Hybrid Script Support
for TIR
Posted by Bohan Hou via Apache TVM Discuss <no...@discuss.tvm.ai>.
@ziheng Sorry for my late reply. The code of `tvm.build` in build_module.py on master branch is attached below.
After we define the TIR PrimFunc with the script, we should be able to put it inside an IRModule and using `tvm.build` as normal.
```python
if isinstance(inputs, schedule.Schedule):
if args is None:
raise ValueError("args must be given for build from schedule")
input_mod = lower(inputs, args, name=name, binds=binds)
elif isinstance(inputs, (list, tuple, container.Array)):
merged_mod = tvm.IRModule({})
for x in inputs:
merged_mod.update(x)
input_mod = merged_mod
elif isinstance(inputs, tvm.IRModule):
input_mod = inputs
elif not isinstance(inputs, (dict, container.Map)):
raise ValueError("inputs must be Schedule, IRModule or dict of target to IRModule")
```
---
[Visit Topic](https://discuss.tvm.apache.org/t/rfc-hybrid-script-support-for-tir/7516/22) 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/7e480180d2107bd04e07a446244a3e1ad232c6fcfaf3f9cd2772bf4b41f881fb).