forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexit.hpp
More file actions
45 lines (35 loc) · 1.37 KB
/
exit.hpp
File metadata and controls
45 lines (35 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2018-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <string>
#include "internal_operation.hpp"
#include "tf_utils.hpp"
namespace ov {
namespace frontend {
namespace tensorflow {
// Internal operation for Exit that marks exit point for data going from Loop in the graph
// It is used along with Enter operation
class Exit : public InternalOperation {
public:
OPENVINO_OP("Exit", "ov::frontend::tensorflow", InternalOperation);
Exit(const Output<Node>& data, const std::shared_ptr<DecoderBase>& decoder = std::make_shared<DecoderFake>())
: InternalOperation(decoder, OutputVector{data}, 1, "Exit") {
validate_and_infer_types();
}
void validate_and_infer_types() override {
auto data_type = get_input_element_type(0);
auto data_shape = get_input_partial_shape(0);
set_output_type(0, data_type, data_shape);
}
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override {
FRONT_END_OP_CONVERSION_CHECK(inputs.size() == 1,
"[TensorFlow Frontend] internal error: Exit expects one input");
auto exit_node = std::make_shared<Exit>(inputs[0], m_decoder);
exit_node->set_attrs(get_attrs());
return exit_node;
}
};
} // namespace tensorflow
} // namespace frontend
} // namespace ov