tile.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 #include "ngraph/runtime/host_tensor.hpp"
9 
10 namespace ngraph
11 {
12  namespace op
13  {
14  namespace v0
15  {
16  /// \brief Dynamic Tiling operation which repeats a tensor multiple times
17  /// along each dimension
18  class NGRAPH_API Tile : public Op
19  {
20  public:
21  static constexpr NodeTypeInfo type_info{"Tile", 0};
22  const NodeTypeInfo& get_type_info() const override { return type_info; }
23  Tile() = default;
24  /// \brief Perform dynamic padding of a tensor
25  ///
26  /// \param data The node producing input tensor to be padded.
27  /// \param repeats The node producing the per-dimension replication factor
28  Tile(const Output<Node>& data, const Output<Node>& repeats);
29 
30  bool visit_attributes(AttributeVisitor& visitor) override;
31  void validate_and_infer_types() override;
32 
33  virtual std::shared_ptr<Node>
34  clone_with_new_inputs(const OutputVector& new_args) const override;
35 
36  bool evaluate(const HostTensorVector& outputs,
37  const HostTensorVector& inputs) const override;
38  bool has_evaluate() const override;
39 
40  private:
41  bool evaluate_tile(const HostTensorVector& outputs,
42  const HostTensorVector& inputs) const;
43  };
44  } // namespace v0
45  } // namespace op
46 } // 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
Dynamic Tiling operation which repeats a tensor multiple times along each dimension.
Definition: tile.hpp:19
bool has_evaluate() const override
Allows to get information about availability of evaluate method for the current operation.
Tile(const Output< Node > &data, const Output< Node > &repeats)
Perform dynamic padding of a tensor.
const NodeTypeInfo & get_type_info() const override
Definition: tile.hpp:22
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
bool evaluate(const HostTensorVector &outputs, const HostTensorVector &inputs) const override
Evaluates the op on input_values putting results in output_values.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27