Skip to content

Commit

Permalink
Update is_nonzero.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhant-0707 committed Oct 25, 2023
1 parent c38793c commit 520deee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frontends/pytorch/src/op/is_nonzero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "openvino/frontend/pytorch/node_context.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/convert_like.hpp"
#include "openvino/op/not_equal.hpp"
#include "pt_framework_node.hpp"
#include "utils.hpp"
Expand All @@ -21,7 +22,7 @@ OutputVector translate_is_nonzero(const NodeContext& context) {

Output<Node> zero_tensor = context.mark_node(v0::Constant::create(element::boolean, Shape{1}, {false}));

align_eltwise_input_types(context, input, zero_tensor);
zero_tensor = context.mark_node(std::make_shared<v1::ConvertLike>(zero_tensor, input));
auto result = context.mark_node(std::make_shared<v1::NotEqual>(input, zero_tensor));

return {result};
Expand Down

0 comments on commit 520deee

Please sign in to comment.