Unable to create Node object to pass to AttrStmt object


#1

Hi, I have been trying to make a tvm.stmt.AttrStmt object using documentation. I am unable to create a Node object to pass it to this AttrStmt object. I have tried all the possibilities:

node_obj = tvm.node/tvm.node.NodeBase <<<----- unable to create this
st_obj=tvm.stmt.Stmt
x = tvm.var(“n”)
exp_obj=x/2
st = tvm.stmt.AttrStmt(node_obj, “Intel”, exp_obj, st_obj)

Can anyone please help me out. I am unable to proceed further because of this.


#2

you can create a subclass of node that is concrete. For example you can do node_obj= tvm.expr.IntImm("int32", 1).


#3

Thank you very much. I am wondering if you could redirect me/provide me a link as to how to create a func (Operation) for Realize/ProducerConsumer stmt then it would be very helpful.

Moreover, since the lower phase 0 in the lower() generates the output (IR) which as a statement reflecting the hardware like in my case, I am executing it on VPU so it is printing

realize
Produce {
for{
for{
VTAUopPush() <<— how to print hardware specific statements?
}
}…