-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 aten::rot90 #28224
base: master
Are you sure you want to change the base?
[PT FE] Add aten::rot90 #28224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, please fix the comments
} else if (k == 2) { | ||
size_t dims_size = dims.size(); | ||
auto flip_dims = context.mark_node(v0::Constant::create(element::i32, Shape{dims_size}, dims)); | ||
rotated = create_flip(input, flip_dims); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails to build with error:
/__w/openvino/openvino/openvino/src/frontends/pytorch/src/op/rot90.cpp: In function 'ov::OutputVector ov::frontend::pytorch::op::translate_rot90(const ov::frontend::pytorch::NodeContext&)':
/__w/openvino/openvino/openvino/src/frontends/pytorch/src/op/rot90.cpp:46:24: error: 'create_flip' was not declared in this scope
46 | auto flipped = create_flip(input, flip_dims);
| ^~~~~~~~~~~
/__w/openvino/openvino/openvino/src/frontends/pytorch/src/op/rot90.cpp:56:19: error: 'create_flip' was not declared in this scope
56 | rotated = create_flip(input, flip_dims);
| ^~~~~~~~~~~
There is no such function as create_flip
num_inputs_check(context, 1, 3); | ||
auto input = context.get_input(0); | ||
int k = context.input_is_none(1) ? 1 : context.const_input<int64_t>(1); | ||
std::vector<int64_t> dims = context.input_is_none(2) ? std::vector<int64_t>{0, 1} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of const_input
get dims
as Node using get_input
and use as is. To avoid requirement for it to be const and to avoid creating a Constant
with dims later.
for (auto& dim : dims) { | ||
dim = (dim + ndims) % ndims; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use normalize_axis
function for this after you change dims
to be a Node rather then constant.
Details:
Tickets: