Skip to content

Conversation

@MyatKaung
Copy link

What
Add PyTorch frontend support for the aten::reverse operator by translating it to OpenVINO’s ReverseSequence op.

Why
Issue #29713 tracks adding reverse support in the PyTorch frontend.

How

  • Implemented translate_reverse in src/frontends/pytorch/src/op/reverse.cpp/.hpp
  • Registered "aten::reverse" in src/frontends/pytorch/src/op_table.cpp
  • Added a layer test in tests/layer_tests/pytorch_tests/test_reverse.py

Ticket
Fixes #29713

@MyatKaung MyatKaung requested a review from a team as a code owner April 5, 2025 12:06
@MyatKaung MyatKaung requested review from mmikolajcz and rkazants April 5, 2025 12:06
@github-actions github-actions bot added the category: PyTorch FE OpenVINO PyTorch Frontend label Apr 5, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Apr 5, 2025
@mvafin mvafin changed the title frontend(pytorch): add aten::reverse support via ReverseSequence and layer test [PT FE] Support aten::reverse operation Apr 7, 2025
@@ -0,0 +1,43 @@
#include "reverse.hpp"
#include "openvino/opsets/opset10.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use opset header, include every operation separetly

Copy link
Contributor

@mvafin mvafin left a comment

Choose a reason for hiding this comment

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

You didn't add your operation in op_table.cpp. It will never be used

Copy link
Contributor

Choose a reason for hiding this comment

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

.hpp is not needed. Declare your conversion in op_table.cpp


# 2. Test signature must include ie_device and precision fixtures
@pytest.mark.parametrize("dim", [0, 1, 2])
def test_reverse_tensor(dim, ie_device, precision):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use class PytorchLayerTest and rewrite the tests to be similar to other tests

@mlukasze
Copy link
Contributor

hey @MyatKaung will you find a time to adress code review requests?

@mlukasze mlukasze closed this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: PyTorch FE OpenVINO PyTorch Frontend ExternalPR External contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Support aten::reverse

4 participants