constant.rst 1.79 KB
Newer Older
1 2 3 4 5 6
.. constant.rst:

########
Constant
########

7 8 9 10 11
.. code-block:: cpp

   Constant // Literal constant tensor


12 13 14 15 16 17 18 19 20 21 22 23
Description
===========

The output is a tensor initialized from the ``values`` attribute.

Attributes
----------

+-----------------+------------------------------+---------------------------------------+
| Name            | Type                         | Notes                                 |
+=================+==============================+=======================================+
| ``type``        | ``ngraph::element::type``    | The element type of the value         |
24
|                 |                              | in the computation                    |
25
+-----------------+------------------------------+---------------------------------------+
26
| ``shape``       | ``ngraph::Shape``            | The shape of the constant             |
27 28 29
+-----------------+------------------------------+---------------------------------------+
| ``values``      | ``const std::vector<T>&``    | Constant elements in row-major order. |
|                 |                              | T must be compatible with the element |
30
|                 |                              | type                                  |
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
+-----------------+------------------------------+---------------------------------------+

Outputs
-------

+-----------------+-------------------------+--------------------------------+
| Name            | Element Type            | Shape                          |
+=================+=========================+================================+
| ``output``      | ``type``                | ``shape``                      |
+-----------------+-------------------------+--------------------------------+


C++ Interface
=============

.. doxygenclass:: ngraph::op::Constant
47
   :project: ngraph
48
   :members: