index.rst 4.13 KB
Newer Older
1
   .. ops/index.rst
Scott Cyphers's avatar
Scott Cyphers committed
2

L.S. Cook's avatar
L.S. Cook committed
3 4 5
####################
List of Core ``ops``
####################
Scott Cyphers's avatar
Scott Cyphers committed
6 7 8

Not currently a comprehensive list.  

9 10
:ref:`more_about`

11 12 13 14 15 16
.. hlist:: 
   :columns: 3

   * :doc:`abs`
   * :doc:`acos`
   * :doc:`add`
17
   * :doc:`all`
18 19
   * :doc:`allreduce`
   * :doc:`and`
20
   * :doc:`any`
21 22 23 24
   * :doc:`asin`
   * :doc:`atan`
   * :doc:`avg_pool`
   * :doc:`avg_pool_backprop`
25 26 27
   * :doc:`batch_norm_inference`
   * :doc:`batch_norm_training`
   * :doc:`batch_norm_training_backprop`
28
   * :doc:`broadcast`
29
   * :doc:`broadcast_distributed`
30 31 32 33 34 35 36
   * :doc:`ceiling`
   * :doc:`concat`
   * :doc:`constant`
   * :doc:`convert`
   * :doc:`convolution`
   * :doc:`cos`
   * :doc:`cosh`
37
   * :doc:`dequantize`
38 39
   * :doc:`divide`
   * :doc:`dot`
40
   * :doc:`drop_out`
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
   * :doc:`equal`
   * :doc:`exp`
   * :doc:`floor`
   * :doc:`get_output_element`
   * :doc:`greater_eq`
   * :doc:`greater`
   * :doc:`less_eq`
   * :doc:`less`
   * :doc:`log`
   * :doc:`max`
   * :doc:`maximum`
   * :doc:`max_pool` 
   * :doc:`min`
   * :doc:`minimum`
   * :doc:`multiply`
   * :doc:`negative`
   * :doc:`not_equal`
   * :doc:`not`
   * :doc:`one_hot`
   * :doc:`or`
   * :doc:`pad`
   * :doc:`parameter`
   * :doc:`power`
   * :doc:`product`
65
   * :doc:`quantize`
66
   * :doc:`relu`
67
   * :doc:`result`
68
   * :doc:`shape_of`
69
   * :doc:`sigmoid`
Scott Cyphers's avatar
Scott Cyphers committed
70 71 72
   * :doc:`sign`
   * :doc:`sin`
   * :doc:`sinh`
Scott Cyphers's avatar
Scott Cyphers committed
73
   * :doc:`slice`
74
   * :doc:`softmax`
Scott Cyphers's avatar
Scott Cyphers committed
75
   * :doc:`sqrt`
76
   * :doc:`subtract`
Scott Cyphers's avatar
Scott Cyphers committed
77
   * :doc:`tan`
78
   * :doc:`tanh`
79
   * :doc:`transpose`
80 81


Scott Cyphers's avatar
Scott Cyphers committed
82 83

.. toctree::
84
   :hidden:
Scott Cyphers's avatar
Scott Cyphers committed
85 86 87 88

   abs.rst
   acos.rst
   add.rst
89
   all.rst
90
   allreduce.rst
91
   and.rst
92
   any.rst
Scott Cyphers's avatar
Scott Cyphers committed
93 94 95 96
   asin.rst
   atan.rst
   avg_pool.rst
   avg_pool_backprop.rst
97 98 99
   batch_norm_inference.rst
   batch_norm_training.rst
   batch_norm_training_backprop.rst
100
   broadcast.rst
101
   broadcast_distributed.rst
102
   ceiling.rst
103
   concat.rst
104 105
   constant.rst
   convert.rst
Scott Cyphers's avatar
Scott Cyphers committed
106
   convolution.rst
107 108
   cos.rst
   cosh.rst
109
   dequantize.rst
110 111
   divide.rst
   dot.rst
112
   drop_out.rst
113 114 115
   equal.rst
   exp.rst
   floor.rst
116
   get_output_element.rst
117 118 119 120 121
   greater_eq.rst
   greater.rst
   less_eq.rst
   less.rst
   log.rst
122
   max.rst
123
   maximum.rst
124 125
   max_pool.rst 
   min.rst
126 127 128 129 130
   minimum.rst
   multiply.rst
   negative.rst
   not_equal.rst
   not.rst
131
   one_hot.rst
132
   or.rst
133
   pad.rst
134 135 136
   parameter.rst
   power.rst
   product.rst
137
   quantize.rst
138
   relu.rst
139
   result.rst
140
   shape_of.rst
141
   sigmoid.rst
Scott Cyphers's avatar
Scott Cyphers committed
142 143 144
   sign.rst
   sin.rst
   sinh.rst
Scott Cyphers's avatar
Scott Cyphers committed
145
   slice.rst
146
   softmax.rst
Scott Cyphers's avatar
Scott Cyphers committed
147
   sqrt.rst
148
   subtract.rst
Scott Cyphers's avatar
Scott Cyphers committed
149
   tan.rst
150
   tanh.rst
151
   transpose.rst
152 153 154 155 156 157 158 159 160 161 162 163 164 165


.. _more_about: 

More about Core Ops
-------------------

An ``Op``'s primary role is to function as a node in a directed acyclic graph 
dependency computation graph.  

*Core ops* are ops that are available and generally useful to all framework 
bridges and that can be compiled by all transformers. A framework bridge may 
define framework-specific ops to simplify graph construction, provided that the 
bridge can enable every transformer to replace all such ops with equivalent 
166
clusters or subgraphs composed of core ops. In a similar manner, transformers may define 
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
transformer-specific ops to represent kernels or other intermediate operations. 

If a framework supports extending the set of ops it offers, a bridge may even 
expose transformer-specific ops to the framework user.


.. figure:: ../graphics/tablengraphops.png
    :width: 535px
    :alt: Operations Available in the nGraph IR 

    Operations Available in the nGraph IR


.. important:: Our design philosophy is that the graph is not a script for 
   running kernels; rather, our compilation will match ``ops`` to appropriate 
   kernels for the backend(s) in use. Thus, we expect that adding of new Core 
   ops should be infrequent and that most functionality instead gets added with 
184
   new functions that build sub-graphs from existing core ops.
185 186 187 188 189 190 191 192 193 194 195 196 197 198

It is easiest to define a new op by adapting an existing op. Some of the tasks 
that must be performed are:

- Op constructor:

  * Checking type-consistency of arguments 
  * Specifying the result type for a call 

- Serializer/Deserializer

- Transformer handlers:

  * Interpreter (reference) implementation of behavior. The
199
    implementation should favor clarity over efficiency.