未验证 提交 398cbb64 编写于 作者: W Wei-Sheng Chin 提交者: GitHub

Add Some Differentiable Tags for The Rest Ops in tensor/defs.cc (#2954)

* [Differentiability tags]
1. Revert Upsample's tags
2. Add some differentiable tags
Signed-off-by: NWei-Sheng Chin <wschin@outlook.com>

* Mark discontinous functions non-differentiable
Signed-off-by: NWei-Sheng Chin <wschin@outlook.com>
上级 37e84915
......@@ -10544,16 +10544,16 @@ This version of the operator has been available since version 11 of the default
#### Inputs
<dl>
<dt><tt>input</tt> : T</dt>
<dt><tt>input</tt> (differentiable) : T</dt>
<dd>Tensor of rank r >= 1.</dd>
<dt><tt>condition</tt> : T1</dt>
<dt><tt>condition</tt> (non-differentiable) : T1</dt>
<dd>Rank 1 tensor of booleans to indicate which slices or data elements to be selected. Its length can be less than the input length along the axis or the flattened input size if axis is not specified. In such cases data slices or elements exceeding the condition length are discarded.</dd>
</dl>
#### Outputs
<dl>
<dt><tt>output</tt> : T</dt>
<dt><tt>output</tt> (differentiable) : T</dt>
<dd>Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.</dd>
</dl>
......@@ -12744,14 +12744,14 @@ This version of the operator has been available since version 11 of the default
#### Inputs
<dl>
<dt><tt>X</tt> (differentiable) : T</dt>
<dt><tt>X</tt> (non-differentiable) : T</dt>
<dd>Input tensor</dd>
</dl>
#### Outputs
<dl>
<dt><tt>Y</tt> (differentiable) : T</dt>
<dt><tt>Y</tt> (non-differentiable) : T</dt>
<dd>Output tensor</dd>
</dl>
......@@ -17604,20 +17604,20 @@ x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized *
#### Inputs (3 - 4)
<dl>
<dt><tt>X</tt> : T1</dt>
<dt><tt>X</tt> (differentiable) : T1</dt>
<dd>N-D tensor</dd>
<dt><tt>roi</tt> : T2</dt>
<dt><tt>roi</tt> (non-differentiable) : T2</dt>
<dd>1-D tensor given as [start1, ..., startN, end1, ..., endN], where N is the rank of X. The RoIs' coordinates are normalized in the coordinate system of the input image. It only takes effect when coordinate_transformation_mode is "tf_crop_and_resize"</dd>
<dt><tt>scales</tt> : tensor(float)</dt>
<dt><tt>scales</tt> (non-differentiable) : tensor(float)</dt>
<dd>The scale array along each dimension. It takes value greater than 0. If it's less than 1, it's sampling down, otherwise, it's upsampling. The number of elements of 'scales' should be the same as the rank of input 'X'. Only one of 'scales' and 'sizes' can be specified. If 'size' is specified, then set scales to empty data (zero shape) in this operator's input list.</dd>
<dt><tt>sizes</tt> (optional) : tensor(int64)</dt>
<dt><tt>sizes</tt> (optional, non-differentiable) : tensor(int64)</dt>
<dd>The size of the output tensor. The number of elements of 'sizes' should be the same as the rank of input 'X'. Only one of 'scales' and 'sizes' can be specified.</dd>
</dl>
#### Outputs
<dl>
<dt><tt>Y</tt> : T1</dt>
<dt><tt>Y</tt> (differentiable) : T1</dt>
<dd>N-D tensor after resizing</dd>
</dl>
......@@ -17884,14 +17884,14 @@ This version of the operator has been available since version 13 of the default
#### Inputs
<dl>
<dt><tt>input</tt> (differentiable) : T</dt>
<dt><tt>input</tt> (non-differentiable) : T</dt>
<dd>Input tensor</dd>
</dl>
#### Outputs
<dl>
<dt><tt>output</tt> (differentiable) : T</dt>
<dt><tt>output</tt> (non-differentiable) : T</dt>
<dd>The sign of the input tensor computed element-wise. It has the same shape and type of the input.</dd>
</dl>
......@@ -18253,7 +18253,7 @@ This version of the operator has been available since version 13 of the default
#### Inputs (1 - 2)
<dl>
<dt><tt>data</tt> : T</dt>
<dt><tt>data</tt> (differentiable) : T</dt>
<dd>Tensors with at least max(dims) dimensions.</dd>
<dt><tt>axes</tt> (optional, non-differentiable) : tensor(int64)</dt>
<dd>List of integers indicating the dimensions to squeeze. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).</dd>
......@@ -18262,7 +18262,7 @@ This version of the operator has been available since version 13 of the default
#### Outputs
<dl>
<dt><tt>squeezed</tt> : T</dt>
<dt><tt>squeezed</tt> (differentiable) : T</dt>
<dd>Reshaped tensor with same data as input.</dd>
</dl>
......
......@@ -2652,16 +2652,16 @@ Other versions of this operator: <a href="Changelog.md#Compress-9">9</a>
#### Inputs
<dl>
<dt><tt>input</tt> : T</dt>
<dt><tt>input</tt> (differentiable) : T</dt>
<dd>Tensor of rank r >= 1.</dd>
<dt><tt>condition</tt> : T1</dt>
<dt><tt>condition</tt> (non-differentiable) : T1</dt>
<dd>Rank 1 tensor of booleans to indicate which slices or data elements to be selected. Its length can be less than the input length along the axis or the flattened input size if axis is not specified. In such cases data slices or elements exceeding the condition length are discarded.</dd>
</dl>
#### Outputs
<dl>
<dt><tt>output</tt> : T</dt>
<dt><tt>output</tt> (differentiable) : T</dt>
<dd>Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.</dd>
</dl>
......@@ -15672,20 +15672,20 @@ x_original = length_resized > 1 ? start_x * (length_original - 1) + x_resized *
#### Inputs (3 - 4)
<dl>
<dt><tt>X</tt> : T1</dt>
<dt><tt>X</tt> (differentiable) : T1</dt>
<dd>N-D tensor</dd>
<dt><tt>roi</tt> : T2</dt>
<dt><tt>roi</tt> (non-differentiable) : T2</dt>
<dd>1-D tensor given as [start1, ..., startN, end1, ..., endN], where N is the rank of X. The RoIs' coordinates are normalized in the coordinate system of the input image. It only takes effect when coordinate_transformation_mode is "tf_crop_and_resize"</dd>
<dt><tt>scales</tt> : tensor(float)</dt>
<dt><tt>scales</tt> (non-differentiable) : tensor(float)</dt>
<dd>The scale array along each dimension. It takes value greater than 0. If it's less than 1, it's sampling down, otherwise, it's upsampling. The number of elements of 'scales' should be the same as the rank of input 'X'. Only one of 'scales' and 'sizes' can be specified. If 'size' is specified, then set scales to empty data (zero shape) in this operator's input list.</dd>
<dt><tt>sizes</tt> (optional) : tensor(int64)</dt>
<dt><tt>sizes</tt> (optional, non-differentiable) : tensor(int64)</dt>
<dd>The size of the output tensor. The number of elements of 'sizes' should be the same as the rank of input 'X'. Only one of 'scales' and 'sizes' can be specified.</dd>
</dl>
#### Outputs
<dl>
<dt><tt>Y</tt> : T1</dt>
<dt><tt>Y</tt> (differentiable) : T1</dt>
<dd>N-D tensor after resizing</dd>
</dl>
......@@ -17020,14 +17020,14 @@ This version of the operator has been available since version 11 of the default
#### Inputs
<dl>
<dt><tt>X</tt> (differentiable) : T</dt>
<dt><tt>X</tt> (non-differentiable) : T</dt>
<dd>Input tensor</dd>
</dl>
#### Outputs
<dl>
<dt><tt>Y</tt> (differentiable) : T</dt>
<dt><tt>Y</tt> (non-differentiable) : T</dt>
<dd>Output tensor</dd>
</dl>
......@@ -18330,14 +18330,14 @@ Other versions of this operator: <a href="Changelog.md#Sign-9">9</a>
#### Inputs
<dl>
<dt><tt>input</tt> (differentiable) : T</dt>
<dt><tt>input</tt> (non-differentiable) : T</dt>
<dd>Input tensor</dd>
</dl>
#### Outputs
<dl>
<dt><tt>output</tt> (differentiable) : T</dt>
<dt><tt>output</tt> (non-differentiable) : T</dt>
<dd>The sign of the input tensor computed element-wise. It has the same shape and type of the input.</dd>
</dl>
......@@ -20506,7 +20506,7 @@ Other versions of this operator: <a href="Changelog.md#Squeeze-1">1</a>, <a href
#### Inputs (1 - 2)
<dl>
<dt><tt>data</tt> : T</dt>
<dt><tt>data</tt> (differentiable) : T</dt>
<dd>Tensors with at least max(dims) dimensions.</dd>
<dt><tt>axes</tt> (optional, non-differentiable) : tensor(int64)</dt>
<dd>List of integers indicating the dimensions to squeeze. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).</dd>
......@@ -20515,7 +20515,7 @@ Other versions of this operator: <a href="Changelog.md#Squeeze-1">1</a>, <a href
#### Outputs
<dl>
<dt><tt>squeezed</tt> : T</dt>
<dt><tt>squeezed</tt> (differentiable) : T</dt>
<dd>Reshaped tensor with same data as input.</dd>
</dl>
......
......@@ -2232,7 +2232,7 @@ ONNX_OPERATOR_SET_SCHEMA(
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
OpSchema::NonDifferentiable)
.Output(
0,
"output",
......@@ -2242,7 +2242,7 @@ ONNX_OPERATOR_SET_SCHEMA(
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
OpSchema::NonDifferentiable)
.TypeConstraint(
"T",
OpSchema::all_numeric_types_with_bfloat(),
......@@ -2624,7 +2624,7 @@ ONNX_OPERATOR_SET_SCHEMA(
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
OpSchema::NonDifferentiable)
.Output(
0,
"Y",
......@@ -2633,7 +2633,7 @@ ONNX_OPERATOR_SET_SCHEMA(
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
OpSchema::NonDifferentiable)
.TypeConstraint(
"T",
{"tensor(float16)", "tensor(float)", "tensor(double)"},
......
......@@ -1564,7 +1564,10 @@ ONNX_OPERATOR_SET_SCHEMA(
"data",
"Tensors with at least max(dims) dimensions.",
"T",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.Input(
1,
"axes",
......@@ -1580,7 +1583,10 @@ ONNX_OPERATOR_SET_SCHEMA(
"squeezed",
"Reshaped tensor with same data as input.",
"T",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.TypeConstraint(
"T",
OpSchema::all_tensor_types_with_bfloat(),
......@@ -2127,13 +2133,19 @@ ONNX_OPERATOR_SET_SCHEMA(
"X",
"N-D tensor",
"T1",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.Input(
1,
"roi",
"1-D tensor given as [start1, ..., startN, end1, ..., endN], where N is the rank of X. The RoIs' coordinates are normalized in the coordinate system of the input image. It only takes effect when coordinate_transformation_mode is \"tf_crop_and_resize\"",
"T2",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::NonDifferentiable)
.Input(
2,
"scales",
......@@ -2141,19 +2153,29 @@ ONNX_OPERATOR_SET_SCHEMA(
" it's sampling down, otherwise, it's upsampling. The number of elements of 'scales' should"
" be the same as the rank of input 'X'. Only one of 'scales' and 'sizes' can be specified. If 'size' is specified, then set scales to empty data (zero shape) in this operator's input list.",
"tensor(float)",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::NonDifferentiable)
.Input(
3,
"sizes",
"The size of the output tensor. The number of elements of 'sizes' should be the same as the"
" rank of input 'X'. Only one of 'scales' and 'sizes' can be specified.",
"tensor(int64)",
OpSchema::Optional)
OpSchema::Optional,
true,
1,
OpSchema::NonDifferentiable)
.Output(
0,
"Y",
"N-D tensor after resizing",
"T1")
"T1",
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.TypeConstraint(
"T1",
OpSchema::all_tensor_types_with_bfloat(),
......@@ -2219,7 +2241,10 @@ ONNX_OPERATOR_SET_SCHEMA(
"input",
"Tensor of rank r >= 1.",
"T",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.Input(
1,
"condition",
......@@ -2228,13 +2253,19 @@ ONNX_OPERATOR_SET_SCHEMA(
"or the flattened input size if axis is not specified. "
"In such cases data slices or elements exceeding the condition length are discarded.",
"T1",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::NonDifferentiable)
.Output(
0,
"output",
"Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.",
"T",
OpSchema::Single)
OpSchema::Single,
true,
1,
OpSchema::Differentiable)
.TypeConstraint(
"T",
OpSchema::all_tensor_types(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册