UID | title | description | tech.root | ms.date | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | dev_langs | topic_type | api_type | api_location | api_name | f1_keywords | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NS:directml.DML_RESAMPLE_OPERATOR_DESC |
DML_RESAMPLE_OPERATOR_DESC |
Resamples elements from the source to the destination tensor, using the scale factors to compute the destination tensor size. You can use a linear or nearest-neighbor interpolation mode. (DML_RESAMPLE_OPERATOR_DESC) |
directml |
01/08/2024 |
directml.h |
Windows |
Windows 10, version 2004 (10.0; Build 19041) |
Windows Server, version 2004 (10.0; Build 19041) |
Windows |
|
|
|
|
|
|
Resamples elements from the source to the destination tensor, using the scale factors to compute the destination tensor size. You can use a linear or nearest-neighbor interpolation mode. The operator supports interpolation across multiple dimensions, not just 2D. So you can keep the same spatial size, but interpolate across channels or across batches.
Type: const DML_TENSOR_DESC*
The tensor containing the input data.
Type: const DML_TENSOR_DESC*
The tensor to write the output data to.
Type: DML_INTERPOLATION_MODE
This field determines the kind of interpolation used to choose output pixels.
-
DML_INTERPOLATION_MODE_NEAREST_NEIGHBOR. Uses the Nearest Neighbor algorithm, which chooses the input element nearest to the corresponding pixel center for each output element.
-
DML_INTERPOLATION_MODE_LINEAR. Uses the Linear Interpolation algorithm, which computes the output element by computing the weighted average of the 2 nearest neighboring input elements per dimension. Resampling is supported up to 4 dimensions (quadrilinear), where the weighted average is computed on a total of 16 input elements for each output element.
Type: UINT
The number of values in the array Scales
points to. This value must match the dimension count of InputTensor and OutputTensor.
Type: _Field_size_(ScaleCount) const FLOAT*
The scales to apply when resampling the input, where scales > 1 scale up the image and scales < 1 scale down the image for that dimension. Note that the scales don't need to be exactly OutputSize / InputSize
. If the input after scaling is larger than the output bound, then we crop it to the output size. On the other hand, if the input after scaling is smaller than the output bound, the output edges are clamped.
A newer version of this operator, DML_RESAMPLE1_OPERATOR_DESC, was introduced in DML_FEATURE_LEVEL_2_1
.
This operator was introduced in DML_FEATURE_LEVEL_2_0
.
InputTensor and OutputTensor must have the same DataType and DimensionCount.
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 1 to 4 | FLOAT32, FLOAT16, INT8, UINT8 |
OutputTensor | Output | 1 to 4 | FLOAT32, FLOAT16, INT8, UINT8 |
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 1 to 4 | FLOAT32, FLOAT16 |
OutputTensor | Output | 1 to 4 | FLOAT32, FLOAT16 |
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 4 | FLOAT32, FLOAT16 |
OutputTensor | Output | 4 | FLOAT32, FLOAT16 |