Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PT FE] Add prim::PythonOp #15714

Merged
merged 13 commits into from
Mar 7, 2023

Conversation

mmikolajcz
Copy link
Contributor

Details:

  • Add handler to allow loading prim::PythonOp subgraph into OV model

Tickets:

  • 101096

@mmikolajcz mmikolajcz requested review from a team as code owners February 14, 2023 15:49
@github-actions github-actions bot added category: Python API OpenVINO Python bindings category: PyTorch FE OpenVINO PyTorch Frontend labels Feb 14, 2023

class prim_pythonop(torch.nn.Module):
def forward(self, input_tensor):
return torch.add(exp_f(input_tensor), 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add test for DeformableConvolution that we have in models?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This op would add torchvision::deform_conv2d into unconverted OP, adding test would require to enable this op as well. I think it might be better to enable it in different PR to not mix it up, but if you want, I could enable this in current PR

@mmikolajcz mmikolajcz requested a review from mvafin February 15, 2023 09:20
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
@mmikolajcz mmikolajcz requested review from mvafin and tomdol February 20, 2023 08:01
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
@mmikolajcz mmikolajcz requested a review from mvafin February 28, 2023 10:41
src/frontends/pytorch/src/op/pythonop.cpp Outdated Show resolved Hide resolved
@mvafin mvafin merged commit 6358974 into openvinotoolkit:master Mar 7, 2023
andrei-cv pushed a commit to andrei-cv/openvino that referenced this pull request Mar 21, 2023
* Add PythonOp

* Fix deprecation & cleanup

* Apply suggestions from code review

* Fix dtype

* Apply suggestions from code review

Co-authored-by: Maxim Vafin <[email protected]>

* Update to new tensor names handling

* Fix negation

* Apply changes from code review

* Remove unnecesary imports

* Update src/frontends/pytorch/src/op/pythonop.cpp

Co-authored-by: Maxim Vafin <[email protected]>

---------

Co-authored-by: Maxim Vafin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings category: PyTorch FE OpenVINO PyTorch Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants