I’m doing a simple add operation where the graph looks like:
graph(%self : ClassType,
%1 : Float(1, 3, 224, 224)):
%2 : Long() = prim::Constant[value={1}]()
%3 : int = prim::Constant[value=1]()
%4 : Float(1, 3, 224, 224) = aten::add(%1, %2, %3)
return (%4)
Which is correct but am seeing that after saving and loading the trace, it changes to:
graph(%self : ClassType,
%argument_1.1 : Tensor):
%3 : Tensor = prim::Constant[value={1}]()
%4 : int = prim::Constant[value=1]()
%5 : Tensor = aten::add(%argument_1.1, %3, %4)
return (%5)
Is there a reason it doesn’t preserve types and names? It seems like a statically allocated tensor is being converted to a dynamic one w/o any size/shape present? I am using torch.jit.save on the trace object and torch.jit.load. Am used to operating on IntType, etc but am not sure how to use TensorType.