abs.rst 1.47 KB
Newer Older
1 2 3 4 5 6
.. abs.rst:

###
Abs
###

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

   Abs  // Elementwise absolute value operation


Scott Cyphers's avatar
Scott Cyphers committed
12 13 14
Description
===========

Scott Cyphers's avatar
Scott Cyphers committed
15
Produces a single output tensor of the same element type and shape as ``arg,``
L.S. Cook's avatar
L.S. Cook committed
16
where the value at each coordinate of ``output`` is the absolute value of the
Scott Cyphers's avatar
Scott Cyphers committed
17 18 19 20
value at each ``arg`` coordinate.

Inputs
------
21 22

+-----------------+-------------------------+--------------------------------+
Scott Cyphers's avatar
Scott Cyphers committed
23
| Name            | Element Type            | Shape                          |
24
+=================+=========================+================================+
Scott Cyphers's avatar
Scott Cyphers committed
25
| ``arg``         | Any                     | Any                            |
26 27
+-----------------+-------------------------+--------------------------------+

Scott Cyphers's avatar
Scott Cyphers committed
28 29 30 31 32 33
Outputs
-------

+-----------------+-------------------------+--------------------------------+
| Name            | Element Type            | Shape                          |
+=================+=========================+================================+
34
| ``output``      | Same as ``arg``         | Same as ``arg``                |
Scott Cyphers's avatar
Scott Cyphers committed
35
+-----------------+-------------------------+--------------------------------+
36 37 38 39 40 41 42


Mathematical Definition
=======================

.. math::

Scott Cyphers's avatar
Scott Cyphers committed
43 44
   \mathtt{output}_{i_0, \ldots, i_{n-1}} = \left|\mathtt{arg}_{i_0,
   \ldots, i_{n-1}}\right|
45 46 47 48 49 50

Backprop
========

.. math::

51
   \overline{\mathtt{arg}} \leftarrow \Delta\ \mathrm{sgn}(\mathtt{arg})
52 53 54 55 56


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

57
.. doxygenclass:: ngraph::op::v0::Abs
58
   :project: ngraph
59
   :members: