Skip to content

Commit

Permalink
[PT FE] Fix pad default value (openvinotoolkit#20401)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvafin authored Oct 12, 2023
1 parent 2604c33 commit 3455580
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,19 @@ PrimListConstructPadReplacer::PrimListConstructPadReplacer() {
input_node = pad_op->input_value(0);
padding = pad_op->input_value(1);
auto mode_node = pad_op->input_value(2).get_node_shared_ptr();
pad_value = pad_op->input_value(3);
if (const auto& fw_node_mode = cast_fw_node(mode_node, "prim::Constant")) {
const auto& attrs = fw_node_mode->get_attrs();
if (attrs.find("string_value") != attrs.end()) {
mode = attrs.at("string_value");
}
}
pad_value = pad_op->input_value(3);
if (const auto& fw_node_mode = cast_fw_node(pad_value.get_node_shared_ptr(), "prim::Constant")) {
const auto& attrs = fw_node_mode->get_attrs();
if (attrs.find("none_value") != attrs.end()) {
pad_value = v0::Constant::create(element::f32, Shape{}, {0});
}
}
} else if ((pad_op = cast_fw_node(m.get_match_root(), "aten::reflection_pad2d"))) {
mode = "reflect";
input_node = pad_op->input_value(0);
Expand Down

0 comments on commit 3455580

Please sign in to comment.