Unverified Commit ab28a4a1 authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Doc for result and subtract. (#1837)

parent 1ef7612a
......@@ -94,12 +94,14 @@ Not currently a comprehensive list.
* :doc:`power`
* :doc:`product`
* :doc:`relu`
* :doc:`result`
* :doc:`sigmoid`
* :doc:`sign`
* :doc:`sin`
* :doc:`sinh`
* :doc:`softmax`
* :doc:`sqrt`
* :doc:`subtract`
* :doc:`tan`
* :doc:`tanh`
......@@ -155,11 +157,13 @@ Not currently a comprehensive list.
power.rst
product.rst
relu.rst
result.rst
sigmoid.rst
sign.rst
sin.rst
sinh.rst
softmax.rst
sqrt.rst
subtract.rst
tan.rst
tanh.rst
.. result.rst:
######
Result
######
.. code-block:: cpp
Result // Allow a value to be a result
Description
===========
Captures a value for use as a function result. The output of the
op is the same as the input.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg`` | Any | Any |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | Same as ``arg`` | Same as ``arg`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\mathtt{output} = \mathtt{arg}
C++ Interface
=============
.. doxygenclass:: ngraph::op::Result
:project: ngraph
:members:
.. subtract.rst:
########
Subtract
########
.. code-block:: cpp
Subtract // Elementwise subtract operation
Description
===========
Elementwise subtract operation.
Produces tensor of the same element type and shape as the two inputs,
where the value at each coordinate of ``output`` is the difference of the
values at the corresponding input coordinates.
Inputs
------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``arg0`` | any | any |
+-----------------+-------------------------+--------------------------------+
| ``arg1`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Outputs
-------
+-----------------+-------------------------+--------------------------------+
| Name | Element Type | Shape |
+=================+=========================+================================+
| ``output`` | same as ``arg0`` | same as ``arg0`` |
+-----------------+-------------------------+--------------------------------+
Mathematical Definition
=======================
.. math::
\mathtt{output}_{i_0, \ldots, i_{n-1}} = \mathtt{arg0}_{i_0, \ldots, i_{n-1}} - \mathtt{arg1}_{i_0, \ldots, i_{n-1}}
Backprop
========
.. math::
\overline{\mathtt{arg0}} &\leftarrow \Delta \\
\overline{\mathtt{arg1}} &\leftarrow -\Delta
C++ Interface
=============
.. doxygenclass:: ngraph::op::Subtract
:project: ngraph
:members:
......@@ -27,7 +27,7 @@ namespace ngraph
class Result : public Op
{
public:
/// \brief Constructs an arcsin operation.
/// \brief Allows a value to be used as a function result.
///
/// \param arg Node that produces the input tensor.
Result(const std::shared_ptr<Node>& arg);
......
......@@ -23,19 +23,6 @@ namespace ngraph
namespace op
{
/// \brief Elementwise subtraction operation.
///
/// ## Inputs
///
/// | | Type | Description |
/// | ------ | --------------------------------- | ------------------------------------------------------ |
/// | `arg0` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and numeric element type. |
/// | `arg1` | \f$N[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of the same shape and element type as `arg0`. |
///
/// ## Output
///
/// | Type | Description |
/// | ---------------------- | -------------------------------------------------------------------------------------------------------------- |
/// | \f$N[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = \texttt{arg0}[i_1,\dots,i_n] - \texttt{arg1}[i_1,\dots,i_n]\f$ |
class Subtract : public util::BinaryElementwiseArithmetic
{
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment