.. index:: pair: class; dnnl::graph::op .. _doxid-classdnnl_1_1graph_1_1op: class dnnl::graph::op ===================== .. toctree:: :hidden: enum_dnnl_graph_op_attr.rst enum_dnnl_graph_op_kind.rst Overview ~~~~~~~~ An op object. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class op: public op_handle { public: // enums enum :ref:`attr`; enum :ref:`kind`; // construction :ref:`op`(size_t id, :ref:`kind` akind, const std::string& verbose_name = ""); :ref:`op`( size_t id, :ref:`kind` akind, const std::vector<:ref:`logical_tensor`>& inputs, const std::vector<:ref:`logical_tensor`>& outputs, const std::string& verbose_name = "" ); // methods void :ref:`add_input`(const :ref:`logical_tensor`& t); void :ref:`add_inputs`(const std::vector<:ref:`logical_tensor`>& ts); void :ref:`add_output`(const :ref:`logical_tensor`& t); void :ref:`add_outputs`(const std::vector<:ref:`logical_tensor`>& ts); template ::value> = true> op& :ref:`set_attr`( :ref:`attr` name, const Type& value ); }; .. _details-classdnnl_1_1graph_1_1op: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ An op object. Construction ------------ .. index:: pair: function; op .. _doxid-classdnnl_1_1graph_1_1op_1ac16a54f4179d73110f5f7942df37a12f: .. ref-code-block:: cpp :class: doxyrest-title-code-block op(size_t id, :ref:`kind` akind, const std::string& verbose_name = "") Constructs an op object with an unique ID, an operation kind, and a name string. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The unique ID of the op. * - akind - The op kind specifies which computation is represented by the op, such as Convolution or ReLU. * - verbose_name - The string added as the op name. .. index:: pair: function; op .. _doxid-classdnnl_1_1graph_1_1op_1a4a2e86def5fc0299c6b67fc02ff8c9eb: .. ref-code-block:: cpp :class: doxyrest-title-code-block op( size_t id, :ref:`kind` akind, const std::vector<:ref:`logical_tensor`>& inputs, const std::vector<:ref:`logical_tensor`>& outputs, const std::string& verbose_name = "" ) Constructs an op object with an unique ID, an operation kind, and input/output logical tensors. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The unique ID of this op. * - akind - The op kind specifies which computation is represented by this op, such as Convolution or ReLU. * - inputs - Input logical tensor to be bound to this op. * - outputs - Output logical tensor to be bound to this op. * - verbose_name - The string added as the op name. Methods ------- .. index:: pair: function; add_input .. _doxid-classdnnl_1_1graph_1_1op_1ab0e18823d70c33b0882eab0557c83c09: .. ref-code-block:: cpp :class: doxyrest-title-code-block void add_input(const :ref:`logical_tensor`& t) Adds an input logical tensor to the op. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - t - Input logical tensor. .. index:: pair: function; add_inputs .. _doxid-classdnnl_1_1graph_1_1op_1a7159cd7dfdbae7d917f48ff7a51beff8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void add_inputs(const std::vector<:ref:`logical_tensor`>& ts) Adds a vector of input logical tensors to the op. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ts - The list of input logical tensors. .. index:: pair: function; add_output .. _doxid-classdnnl_1_1graph_1_1op_1a8492588050f70b9bb4a27fef16c0027a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void add_output(const :ref:`logical_tensor`& t) Adds an output logical tensor to the op. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - t - Output logical tensor. .. index:: pair: function; add_outputs .. _doxid-classdnnl_1_1graph_1_1op_1a9afad8a6451e194fa6de1ffca1a8cf98: .. ref-code-block:: cpp :class: doxyrest-title-code-block void add_outputs(const std::vector<:ref:`logical_tensor`>& ts) Adds a vector of output logical tensors to the op. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ts - The list of output logical tensors. .. index:: pair: function; set_attr .. _doxid-classdnnl_1_1graph_1_1op_1ab668a4f176f86967dd6fe2a7478f008f: .. ref-code-block:: cpp :class: doxyrest-title-code-block template ::value> = true> op& set_attr( :ref:`attr` name, const Type& value ) Sets the attribute according to the name and type (int64_t). .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Type - Attribute's type. * - name - Attribute's name. * - value - The attribute's value. .. rubric:: Returns: The Op self.