Conversion Sync Task
The Conversion sync task changes the dtype of a tensor on the GPU. The configured target dtype and strategy determine how samples are interpreted or rescaled before being written to the output tensor.
Supported combinations are:
uint8->complex32with theRealstrategy (real part copied, imaginary part set to zero)uint16->complex32with theRealstrategyfloat32->uint8with theScaledstrategyfloat32->uint16with theScaledstrategycomplex32->float32with theModulusstrategycomplex32->float32with theArgumentstrategy
The Scaled strategy computes the minimum and maximum value of the input tensor, then linearly maps the range to fill the target integer interval by rescaling the (min, max) interval to the min and max of the target interval. The Modulus and Argument strategies operate element-wise on complex tensors, returning magnitude or phase respectively.
Warning
When using the Scaled strategy, constant inputs (where min == max) lead to an undefined scale factor. Make sure the source tensor spans a non-zero range.
Inputs
This task consumes a single input tensor of any shape.
The dtype of the input tensor must be one of:
uint8uint16float32complex32
The memory location of the input tensor must be device memory.
Outputs
This task produces one output tensor with the same shape as the input.
The dtype of the output tensor is determined by the configured target dtype.
The memory location of the output tensor is device memory.
Inplace
This task does not support inplace operation.
Ownership
This task does not own any inputs or outputs.
Settings
Example:
| Property | Pattern | Type | Deprecated | Definition | Title/Description |
|---|---|---|---|---|---|
| + target | No | enum (of string) | No | - | Desired output data type. Accepted values: - U8: 8-bit unsigned integer - U16: 16-bit unsigned integer - F32: 32-bit float - CF32: 32-bit complex float |
| + strategy | No | enum (of string) | No | - | Conversion strategy to apply. Accepted values: - Real: Extract real component (valid when target is CF32 and the input is U8/U16) - Scaled: Normalize float input to integer range (valid when target is U8 or U16 and the input is F32) - Modulus: Emit magnitude (valid when target is F32 and the input is CF32) - Argument: Emit phase angle (valid when target is F32 and the input is CF32) |