DML_VALUE_SCALE_2D_OPERATOR_DESC structure (directml.h)

Performs an element-wise scale-and-bias function, Output = Scale * Input + Bias. This operator is similar to using an DML_ELEMENT_WISE_IDENTITY_OPERATOR_DESC with a scale and bias, except that DML_VALUE_SCALE_2D_OPERATOR_DESC applies a different bias for each channel, rather than a single bias for the entire tensor.

Syntax

struct DML_VALUE_SCALE_2D_OPERATOR_DESC {
  const DML_TENSOR_DESC *InputTensor;
  const DML_TENSOR_DESC *OutputTensor;
  FLOAT                 Scale;
  UINT                  ChannelCount;
  const FLOAT           *Bias;
};

Members

InputTensor

Type: const DML_TENSOR_DESC*

A tensor containing the Input data. This tensor's dimensions should be { BatchCount, ChannelCount, Height, Width }.

OutputTensor

Type: const DML_TENSOR_DESC*

A tensor with which to write the results to. This tensor's dimensions should match the InputTensor's dimensions.

Scale

Type: FLOAT

Scale value to be applied to all input values.

ChannelCount

Type: UINT

This field determines the size of the Bias array. This field must be set to either 1 or 3, and must also match the size of the Channel dimension of the input tensor.

Bias

Type: const FLOAT*

An array of FLOAT values containing the bias term for each dimension of the input tensor.

Availability

This operator was introduced in DML_FEATURE_LEVEL_1_0.

Tensor constraints

InputTensor and OutputTensor must have the same DataType and Sizes.

Tensor support

Tensor Kind Supported dimension counts Supported data types
InputTensor Input 4 FLOAT32, FLOAT16
OutputTensor Output 4 FLOAT32, FLOAT16

Requirements

Requirement Value
Header directml.h