Skip to content

[tmva][sofie] Add support for parsing onnx::Add operator in PyTorch parser#21398

Open
MrViiV wants to merge 2 commits intoroot-project:masterfrom
MrViiV:add-pytorch-add-operator
Open

[tmva][sofie] Add support for parsing onnx::Add operator in PyTorch parser#21398
MrViiV wants to merge 2 commits intoroot-project:masterfrom
MrViiV:add-pytorch-add-operator

Conversation

@MrViiV
Copy link

@MrViiV MrViiV commented Feb 26, 2026

This Pull request:

Changes or fixes:

This PR adds support for parsing the onnx::Add operator in the SOFIE PyTorch parser (RModelParser_PyTorch.cxx).

The Add operator is a fundamental element-wise tensor operation and is widely used in modern neural network architectures, including residual connections (e.g. ResNet), transformer blocks, and other composite models exported from PyTorch.

Specifically, this PR:

  • Implements the MakePyTorchAdd function to prepare the corresponding ROperator_BasicBinary with EBasicBinaryOperator::Add
  • Registers the "onnx::Add" operator in the PyTorch parser operator map
  • Reuses the existing SOFIE binary operator infrastructure, ensuring consistency with the ONNX parser implementation

This improves the PyTorch parser’s compatibility with real-world exported ONNX models.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Testing:

A minimal PyTorch model containing an Add operation was exported to ONNX and verified to produce an onnx::Add node compatible with this parser extension.

@MrViiV MrViiV requested a review from lmoneta as a code owner February 26, 2026 20:25
@MrViiV
Copy link
Author

MrViiV commented Feb 26, 2026

@lmoneta @sanjibansg
This PR adds support for parsing onnx::Add operator in the PyTorch parser. I would appreciate your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant