You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by 王鹤男 via Apache TVM Discuss <no...@discuss.tvm.ai> on 2020/09/29 10:01:14 UTC

[Apache TVM Discuss] [Questions] [SOVLED] DLPACK ERROR: AttributeError: Module has no function ‘__tvm_main__’


I found that I can simply use DLPACK to convert tvm tensor to pytorch tensor and vice versa. The problem has been solved!

    from torch.utils.dlpack import to_dlpack, from_dlpack
    from tvm.runtime import ndarray
    ...
    m.set_input('input1', ndarray.from_dlpack(to_dlpack(input1)))
    ...
    pytorch_output = from_dlpack(tvm_output.to_dlpack())





---
[Visit Topic](https://discuss.tvm.apache.org/t/sovled-dlpack-error-attributeerror-module-has-no-function-tvm-main/8029/5) 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/f30bf38d1cfc1c52b2e394a8202e5e3a9e4e455cfc1413d6e98345f45d23b89c).