-
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
[PyTorch] : implement support for replicated{1,2,3} pad #28271
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: 11happy <[email protected]>
humble ping! |
build_jenkins |
Signed-off-by: 11happy <[email protected]>
Signed-off-by: 11happy <[email protected]>
build_jenkins |
Signed-off-by: 11happy <[email protected]>
I have fixed the code style , ran clang-format. |
build_jenkins |
Signed-off-by: 11happy <[email protected]>
humble ping! |
build_jenkins |
Signed-off-by: 11happy <[email protected]>
build_jenkins |
class TestReplicatePad1D(PytorchLayerTest): | ||
def _prepare_input(self, ndim=4, dtype="float32"): | ||
import numpy as np | ||
input_5d_shape = [5,9,1,1,2,4] |
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.
please remove input_5d_shape
and ndim
from here and add normal input_shape
to @pytest.mark.parametrize
.
The same comment for other tests
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.
done,
please suggest the input_shapes to keep, currently kept random from my end,
thank you
Signed-off-by: 11happy <[email protected]>
Signed-off-by: 11happy <[email protected]>
I think in reflection pad as well we can change |
Yes, please do the same for reflection_pad, and constant_padnd as it is similar. You would need to add the entries in op_table.cpp for TS table. |
Signed-off-by: 11happy <[email protected]>
Signed-off-by: 11happy <[email protected]>
Signed-off-by: 11happy <[email protected]>
Signed-off-by: 11happy <[email protected]>
src/frontends/pytorch/src/op/pad.cpp
Outdated
num_inputs_check(context, 2, 2); | ||
auto data = context.get_input(0); | ||
auto paddings = context.const_input<std::vector<int64_t>>(1); | ||
Output<Node> pad_value = context.mark_node(v0::Constant::create(element::f32, Shape{}, {0})); | ||
return translate_pad_common(context, data, paddings, pad_value, "reflect"); | ||
} | ||
|
||
OutputVector translate_replicate_pad_nd(const NodeContext & context) { |
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.
OutputVector translate_replicate_pad_nd(const NodeContext & context) { | |
OutputVector translate_replicate_pad_nd(const NodeContext& context) { |
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.
fixed
{"aten.replicate_pad1d.default", op::translate_replicate_pad_nd}, | ||
{"aten.replicate_pad2d.default", op::translate_replicate_pad_nd}, | ||
{"aten.replicate_pad3d.default", op::translate_replicate_pad_nd}, |
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.
Tests for torch.export fail. I can see that names are wrong, but tests fail on torch side, please check them
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.
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.
I have corrected the names. Thank you
Signed-off-by: 11happy <[email protected]>
Overview:
This pull request fixes #23322.
Testing:
CC: