ctc_greedy_decoder.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/op/op.hpp"
8 
9 namespace ngraph
10 {
11  namespace op
12  {
13  namespace v0
14  {
15  class NGRAPH_API CTCGreedyDecoder : public Op
16  {
17  public:
18  static constexpr NodeTypeInfo type_info{"CTCGreedyDecoder", 0};
19  const NodeTypeInfo& get_type_info() const override { return type_info; }
20  CTCGreedyDecoder() = default;
21  /// \brief Constructs a CTCGreedyDecoder operation
22  ///
23  /// \param input Logits on which greedy decoding is performed
24  /// \param seq_len Sequence lengths
25  /// \param ctc_merge_repeated Whether to merge repeated labels
27  const Output<Node>& seq_len,
28  const bool ctc_merge_repeated);
29 
30  void validate_and_infer_types() override;
31  bool visit_attributes(AttributeVisitor& visitor) override;
32  virtual std::shared_ptr<Node>
33  clone_with_new_inputs(const OutputVector& new_args) const override;
34 
35  bool get_ctc_merge_repeated() const { return m_ctc_merge_repeated; }
36 
37  private:
38  bool m_ctc_merge_repeated;
39  };
40  } // namespace v0
41  using v0::CTCGreedyDecoder;
42  } // namespace op
43 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Root of all actual ops.
Definition: op.hpp:17
Definition: ctc_greedy_decoder.hpp:16
CTCGreedyDecoder(const Output< Node > &input, const Output< Node > &seq_len, const bool ctc_merge_repeated)
Constructs a CTCGreedyDecoder operation.
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
const NodeTypeInfo & get_type_info() const override
Definition: ctc_greedy_decoder.hpp:19
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27