IIRC we made some immutability assumptions here that the passes won't modify
the original `IRModule`. We did find some bugs in the codebase previously the
module is incorrectly modified though :-(
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficiently-copy-an-ir/10798/5)
t
This case seems to occur when we apply the basic block form pass. Other passes,
e.g., `FuseOps` will not result in such results. So I am wondering if it is
expected to modify the input argument (old module) by some passes.
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficien
@junrushao1994 Thank you Junru! It did become faster!

Another related question is: will passes alter the original module (i mean if
`mod` will be modified after applying `new_mod = pass(mod)`). It seems this is
the case and I have to
In terms of deep copy, the most efficient way is SaveJSON and LoadJSON >_<
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficiently-copy-an-ir/10798/2)
to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click
here](h
Hi all, I wonder how to copy an IR in tvm:
What I tried:
1. `deepcopy`: not working. will produce error for some IR.
2. `astext` + `fromtext`: will work but kinda slow (2s for big models).
Thanks!
---
[Visit
Topic](https://discuss.tvm.apache.org/t/how-to-efficiently-copy-an-ir/10798/1)