-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add operation definition documents
- Loading branch information
1 parent
c02bb43
commit d19d0f7
Showing
101 changed files
with
6,202 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# AbsBackprop {#dev_guide_op_absbackprop} | ||
|
||
**Versioned name**: *AbsBackprop-1* | ||
|
||
**Category**: *Arithmetic* | ||
|
||
**Short description**: *AbsBackprop* computes gradient for Abs | ||
|
||
\f$ds = \begin{cases} | ||
dd & \text{if } s>0 \\ | ||
-dd & \text{if } s<0 \\ | ||
0 & \text{if } s=0 | ||
\end{cases} \f$ | ||
|
||
## Inputs | ||
|
||
* **1**: ``input_forward`` - original input tensor of Abs op. **Required.** | ||
|
||
* **Type**: T | ||
|
||
* **2**: ``output_delta`` - the gradient tensor with respect to the output. | ||
**Required.** | ||
|
||
* **Type**: T | ||
|
||
## Outputs | ||
|
||
* **1**: ``input_delta`` - the gradient tensor with respect to the input of | ||
Abs. | ||
|
||
* **Type**: T | ||
|
||
**Types**: | ||
|
||
* **T**: f32, f16, bf16. | ||
* **Note**: Inputs and outputs have the same data type denoted by *T*. For | ||
example, if input is f32 tensor, then all other tensors have f32 data type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Add {#dev_guide_op_add} | ||
|
||
**Versioned name**: *Add-1* | ||
|
||
**Category**: *Arithmetic* | ||
|
||
**Short description**: *Add* performs element-wise addition operation with two | ||
given tensors applying multi-directional broadcast rules. | ||
|
||
## Detailed description | ||
|
||
Before performing arithmetic operation, *input_1* and *input_2* are broadcasted | ||
if their shapes are different and ``auto_broadcast`` attributes is | ||
not ``none``. Broadcasting is performed according to ``auto_broadcast`` value. | ||
|
||
After broadcasting *Add* does the following with *input_1* and *input_2*: | ||
|
||
\f$output_i = input\_1_{i}+input\_2_{i}\f$ | ||
|
||
## Attributes | ||
|
||
* *auto_broadcast* | ||
|
||
* **Description**: specifies rules used for auto-broadcasting of input | ||
tensors. | ||
* **Range of values**: | ||
|
||
* *none* - no auto-broadcasting is allowed, all input shapes should match | ||
* *numpy* - numpy broadcasting rules, aligned with ONNX Broadcasting. | ||
Description is available in | ||
[ONNX docs](https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md). | ||
|
||
* **Type**: string | ||
* **Default value**: *numpy* | ||
* **Required**: *no* | ||
|
||
## Inputs | ||
|
||
* **1**: ``input_1`` - the first input tensor. **Required.** | ||
|
||
* **Type**: T | ||
|
||
* **2**: ``input_2`` - the second input tensor. **Required.** | ||
|
||
* **Type**: T | ||
|
||
## Outputs | ||
|
||
* **1**: ``output`` - the output tensor of element-wise addition operation. | ||
|
||
* **Type**: T | ||
|
||
**Types**: | ||
|
||
* **T**: f32, f16, bf16. | ||
* **Note**: Inputs and outputs have the same data type denoted by *T*. For | ||
example, if input is f32 tensor, then all other tensors have f32 data type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# AvgPool {#dev_guide_op_avgpool} | ||
|
||
**Versioned name**: *AvgPool-1* | ||
|
||
**Category**: *Pooling* | ||
|
||
**Short description**: [Reference](http://caffe.berkeleyvision.org/tutorial/layers/pooling.html) | ||
|
||
**Detailed description**: [Reference](http://cs231n.github.io/convolutional-networks/#pool) | ||
|
||
## Attributes | ||
|
||
* *strides* | ||
|
||
* **Description**: *strides* is a distance (in pixels) to slide the window on | ||
the feature map over the `(z, y, x)` axes for 3D poolings and `(y, x)` axes | ||
for 2D poolings. For example, *strides* equal `(4, 2, 1)` means sliding the | ||
window 4 pixel at a time over depth dimension, 2 over height dimension and | ||
1 over width dimension. | ||
* **Range of values**: Non-negative s64 value | ||
* **Type**: s64[] | ||
* **Required**: *yes* | ||
|
||
* *pads_begin* | ||
|
||
* **Description**: *pads_begin* is a number of pixels to add to the beginning | ||
along each axis. For example, *pads_begin* equal `(1, 2)` means adding 1 | ||
pixel to the top of the input and 2 to the left of the input. | ||
* **Range of values**: Non-negative s64 values. | ||
* **Type**: s64[] | ||
* **Required**: *yes* | ||
* **Note**: the attribute is ignored when *auto_pad* attribute is specified. | ||
|
||
* *pads_end* | ||
|
||
* **Description**: *pads_end* is a number of pixels to add to the ending along | ||
each axis. For example, *pads_end* equal `(1, 2)` means adding 1 pixel to the | ||
bottom of the input and 2 to the right of the input. | ||
* **Range of values**: Non-negative s64 values. | ||
* **Type**: s64[] | ||
* **Required**: *yes* | ||
* **Note**: the attribute is ignored when *auto_pad* attribute is specified. | ||
|
||
* *kernel* | ||
|
||
* **Description**: *kernel* is a size of each filter. For example, *kernel* | ||
equal `(2, 3)` means that each filter has height equal to 2 and width equal | ||
to 3. | ||
* **Range of values**: positive s64 values. | ||
* **Type**: s64[] | ||
* **Required**: *yes* | ||
|
||
* *exclude_pad* | ||
|
||
* **Description**: *exclude_pad* is a type of pooling strategy for values in | ||
the padding area. For example, if *exclude_pad* is *true*, zero-values in | ||
the padding are not used. | ||
* **Range of values**: True or False | ||
* **Type**: bool | ||
* **Required**: *yes* | ||
|
||
* *rounding_type* | ||
|
||
* **Description**: *rounding_type* is a type of rounding to be applied. | ||
* **Range of values**: | ||
|
||
* *ceil* | ||
* *floor* | ||
|
||
* **Type**: string | ||
* **Default value**: *floor* | ||
* **Required**: *no* | ||
|
||
* *auto_pad* | ||
|
||
* **Description**: *auto_pad* how the padding is calculated. Possible values: | ||
|
||
* *none (not specified)*: use explicit padding values. | ||
* *same_upper (same_lower)* the input is padded to match the output size. | ||
In case of odd padding value an extra padding is added at the end (at the | ||
beginning). | ||
* *valid* - do not use padding. | ||
|
||
* **Type**: string | ||
* **Default value**: *none* | ||
* **Required**: *no* | ||
* **Note**: *pads_begin* and *pads_end* attributes are ignored when *auto_pad* | ||
is specified. | ||
|
||
* *data_format* | ||
|
||
* **Description**: *data_format* denotes the data format of the input and | ||
output data. | ||
* **Range of values**: *NXC* or *NCX* (X means HW for 2D, DHW for 3D) | ||
* **Type**: string | ||
* **Default value**: *NXC* | ||
* **Required**: *no* | ||
|
||
## Inputs | ||
|
||
* **1**: ``input`` - input tensor. **Required.** | ||
|
||
* **Type**: T | ||
|
||
## Outputs | ||
|
||
* **1**: ``output`` - the result tensor. | ||
|
||
* **Type**: T | ||
|
||
**Types**: | ||
|
||
* **T**: f32, f16, bf16. | ||
* **Note**: Inputs and outputs have the same data type denoted by *T*. For | ||
example, if input is f32 tensor, then all other tensors have f32 data type. |
Oops, something went wrong.