Input values vs. kernel weights in ONNX output


I’m wrote out a pytorch model with torch.onnx (I’m aware that it is relatively new) to visualize its structure.

I wonder whether there is any way to distinguish between the input variables and ‘fixed’ inputs
like convolution kernel or bias weights ?

For the moment, I get graphs like this:

where e.g. input 3 is a tensor with convolution filter weights as opposed to input 1 which is a tensor of input variables.

best regards,


In fact, it turns out that when saving the model with weights (export_params = True in the call to torch.onnx.export()) the saved model contains a field initializer in the model graph which allows to distinguish network inputs (no corresponding entry in initializer) from model weights (which have an initializer)