How to get the argument name and return value name of operation?

I have a function like this

func.func @cpu_func1(%arg0: tensor<1x64x55x55xf32>) → (tensor<1x64x55x55xf32>, tensor<1x64x55x55xf32>) attributes {kernel_type = “cpu”} {
%0 = “onnx.Identity”(%arg0) <{doNothing = 1 : i64}> : (tensor<1x64x55x55xf32>) → tensor<1x64x55x55xf32>
%1 = “onnx.Identity”(%0) <{doNothing = 1 : i64}> : (tensor<1x64x55x55xf32>) → tensor<1x64x55x55xf32>
return %0, %1 : tensor<1x64x55x55xf32>, tensor<1x64x55x55xf32>
}

How can I get the the argument name %0 and return name %1 in %1 = "onnx.Identity"(%0)?

You can’t. These numbers are meaningless and are generated by the printer when the IR is being printed. They are not part of the IR itself.

We really need a FAQ page. This same questions is asked roughly once a month. :slight_smile:

1 Like