DML_ELEMENT_WISE_IS_INFINITY_OPERATOR_DESC structure (directml.h)
Checks each element of InputTensor for IEEE-754 -inf, inf, or both, depending on the given InfinityMode, and places the result (1 for true, 0 for false) into the corresponding element of OutputTensor.
f(x) = isinf(x) && (
(x > 0 && InfinityMode == DML_IS_INFINITY_MODE_POSITIVE) ||
(x < 0 && InfinityMode == DML_IS_INFINITY_MODE_NEGATIVE) ||
InfinityMode == DML_IS_INFINITY_MODE_EITHER)
Syntax
struct DML_ELEMENT_WISE_IS_INFINITY_OPERATOR_DESC {
const DML_TENSOR_DESC *InputTensor;
const DML_TENSOR_DESC *OutputTensor;
DML_IS_INFINITY_MODE InfinityMode;
};
Members
InputTensor
Type: const DML_TENSOR_DESC*
The input tensor to read from.
OutputTensor
Type: const DML_TENSOR_DESC*
The output tensor to write the results to.
InfinityMode
Type: DML_IS_INFINITY_MODE
A DML_IS_INFINITY_MODE determining the sign of the infinity to check for.
- If DML_IS_INFINITY_MODE_EITHER, then 1 will be returned if the element is -inf or inf, otherwise 0.
- If DML_IS_INFINITY_MODE_POSITIVE, then 1 will be returned if the element is inf, otherwise 0.
- If DML_IS_INFINITY_MODE_NEGATIVE`, then 1 will be returned if the element is -inf, otherwise 0.
Remarks
Availability
This operator was introduced in DML_FEATURE_LEVEL_2_1
.
Tensor constraints
InputTensor and OutputTensor must have the same DimensionCount and Sizes.
Tensor support
DML_FEATURE_LEVEL_3_0 and above
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 1 to 8 | FLOAT32, FLOAT16 |
OutputTensor | Output | 1 to 8 | UINT8 |
DML_FEATURE_LEVEL_2_1 and above
Tensor | Kind | Supported dimension counts | Supported data types |
---|---|---|---|
InputTensor | Input | 4 | FLOAT32, FLOAT16 |
OutputTensor | Output | 4 | UINT8 |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10, version 2004 (10.0; Build 19041) |
Minimum supported server | Windows Server, version 2004 (10.0; Build 19041) |
Header | directml.h |