Is there a way to discern self.consttensor
from input
in AOT FX graph? For the test example, is there any attribute or method that tells that arg3_1 is the input
, and arg2_1 is the self.consttensor
. The input always goes in the end of the arg list, but the model could have variable number of inputs
class Model(torch.nn.Module):
def __init__(self):
super(Model, self).__init__()
self.linear = torch.nn.Linear(20, 30)
self.consttensor = torch.randn(1, 30)
def forward(self, input):
out = self.linear(input)
out = out + self.consttensor
return out
opcode name target args kwargs
------------- ------ ------------------ ------------------- --------
placeholder arg0_1 arg0_1 () {}
placeholder arg1_1 arg1_1 () {}
placeholder arg2_1 arg2_1 () {}
placeholder arg3_1 arg3_1 () {}
call_function t aten.t.default (arg0_1,) {}
call_function addmm aten.addmm.default (arg1_1, arg3_1, t) {}
call_function add aten.add.Tensor (addmm, arg2_1) {}
output output output ((add,),) {}