Skip to content

Commit

Permalink
Fix logic for NCHW
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu-S committed Mar 23, 2024
1 parent 91e1d48 commit 245b986
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/frontends/tensorflow_common/src/op/bias_add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ OutputVector translate_bias_add_op(const NodeContext& node) {
TENSORFLOW_OP_VALIDATION(node,
value_shape.rank().is_static(),
"Value of dynamic rank for BiasAdd in NCHW layout is not supported.");
auto value_rank = complex_type_inputs ? value_shape.rank().get_length() : value_shape.rank().get_length();
auto value_rank = complex_type_inputs ? value_shape.rank().get_length() - 1 : value_shape.rank().get_length();

std::vector<int64_t> axes_unsqueeze;
for (int64_t dim_ind = 0; dim_ind < value_rank; ++dim_ind) {
if (!complex_type_inputs && dim_ind != 1) {
axes_unsqueeze.push_back(dim_ind);
}
if (complex_type_inputs && dim_ind != 2){
if (dim_ind != 1) {
axes_unsqueeze.push_back(dim_ind);
}
}
Expand Down

0 comments on commit 245b986

Please sign in to comment.