[PT FE] aten::concat (#19101)

* [PT FE] aten::concat

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

* add out

* fix tests
This commit is contained in:
Ekaterina Aidova authored and GitHub committed 2023-08-11 15:49:18 +04:00
1 parent a957764362
commit 9fd8a13fe6
4 files changed
+74 -27

No files matched your search

+6 -2
View File
@@ -41,10 +41,14 @@ OutputVector translate_cat_common(const NodeContext& context,
OutputVector translate_cat(const NodeContext& context) {
// This translator is only needed to get axis as constant from external scope
num_inputs_check(context, 2, 2);
num_inputs_check(context, 2, 3);
const auto&& list_elems = get_list_as_outputs(context.get_input(0));
auto axis = context.const_input<int64_t>(1);
return translate_cat_common(context, list_elems, axis);
auto out = translate_cat_common(context, list_elems, axis);
if (!context.input_is_none(2)) {
context.mutate_input(2, out[0]);
}
return out;
};
OutputVector translate_cat_fx(const NodeContext& context) {
+1
View File
@@ -248,6 +248,7 @@ const std::map<std::string, CreatorFunction> get_supported_ops_ts() {
{"aten::bmm", op::translate_1to1_match_2_inputs<opset10::MatMul>},
{"aten::Bool", op::translate_bool},
{"aten::cat", op::translate_cat},
{"aten::concat", op::translate_cat},
{"aten::cdist", op::translate_cdist},
{"aten::ceil", op::translate_1to1_match_1_inputs<opset10::Ceiling>},
{"aten::ceil_", op::inplace_op<op::translate_1to1_match_1_inputs<opset10::Ceiling>>},
@@ -37,6 +37,8 @@ AtenCatToConcat::AtenCatToConcat() {
ov::matcher_pass_callback callback = [](ov::pass::pattern::Matcher& m) {
auto cat = cast_fw_node(m.get_match_root(), "aten::cat");
if (!cat)
cat = cast_fw_node(m.get_match_root(), "aten::concat");
if (!cat)
cat = cast_fw_node(m.get_match_root(), "quantized::cat");
if (!cat)