@areusch @junrushao1994 I have added a section to say how constants are added 
to the IRModule, now.

Summary :

The storage of constants in the IRModule, will be in "Constants" attribute as 
Array\<NDArray>

Basically, if the tir.allocate_const node is created first, then the PrimFunc 
and lastly if it gets added to the IRModule, IRModule::Add(...) will need to 
traverse the stmts and fetch the constants and store the ObjectRefs in the 
IRModule and cross-update the optional index in the allocate_const node.

On the other hands, if the constants are already present in the IRModule, the 
tir.allocate_const could be created using the NDArray ObjectRef and the index 
of NDarray in the IRModule, directly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/22#issuecomment-928888645

Reply via email to