InterpolateBackward#
InterpolateBackward computes the gradients of Interpolate operation.
Operation Attributes#
|
Description |
Value Type |
|
|
|---|---|---|---|---|
Specifies type of in terpolation |
string |
|
Required |
|
Specifies how to transform the coordinate in the resized tensor to the coordinate in the original tensor |
string |
|
Optional |
|
Specifies dst shape for spatial axes. |
s64 |
A s64 list
containing
positive
values,
|
Optional |
|
Specifies
|
f32 |
A f32 list,
|
Optional |
|
Controls
how to
interpret
the shape
of |
string |
|
Optional |
@note Either sizes or scales should be provided. When sizes
is used, scales will be ignored.
@note The attribute coordinate_transformation_mode is the name of
transformation mode in string format.n Here scale[x]
is dst_shape[x]/src_shape[x] and x_resized is a coordinate in
axis x,for any axis x from the src axis.n For
half_pixel: the coordinate in the original tensor axis x is
calculated as ((x_resized + 0.5) / scale[x]) - 0.5.n
For align_corners: the coordinate in the original tensor axis x
is calculated as 0 if dst_shape[x] == 1 else
x_resized * (src_shape[x] - 1) / (dst_shape[x] - 1).n
Execution Arguments#
The inputs and outputs must be provided according to the below index order when constructing an operation.
Inputs#
Index |
Argument Name |
Required or Optional |
|---|---|---|
0 |
|
Required |
1 |
|
Required |
2 |
|
Optional |
@note src is original input tensor of Interpolate op.n
diff_dst is the gradient tensor with respect to the
dst.n sizes is a 1D tensor describing output shape for
spatial axes.
Outputs#
Index |
Argument Name |
Required or Optional |
|---|---|---|
0 |
|
Required |
@note diff_src is the gradient tensor with respect to the src of
Interpolate.
Supported Data Types#
InterpolateBackward operation supports the following data type combinations.
Src |
Diff_dst |
Diff_src |
Sizes |
|---|---|---|---|
f32 |
f32 |
f32 |
s32 |
bf16 |
bf16 |
bf16 |
s32 |
f16 |
f16 |
f16 |
s32 |