Edit

Share via


DML_MEAN_VARIANCE_NORMALIZATION2_OPERATOR_DESC structure (directml.h)

TBD

Important

This API is available as part of the DirectML standalone redistributable package (see Microsoft.AI.DirectML version 1.15.0 and later. Also see DirectML version history.

Syntax

C++
struct DML_MEAN_VARIANCE_NORMALIZATION2_OPERATOR_DESC
{
    const DML_TENSOR_DESC* InputTensor;
    _Maybenull_ const DML_TENSOR_DESC* ScaleTensor;
    _Maybenull_ const DML_TENSOR_DESC* BiasTensor;
    const DML_TENSOR_DESC* OutputTensor;
    UINT AxisCount;
    _Field_size_(AxisCount) const UINT* Axes;
    BOOL UseMean;
    BOOL UseVariance;
    FLOAT Epsilon;
    _Maybenull_ const DML_OPERATOR_DESC* FusedActivation;
};

Members

InputTensor

Type: const DML_TENSOR_DESC*

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

ScaleTensor

Type: _Maybenull_ const DML_TENSOR_DESC*

An optional tensor containing the Scale data.

If DML_FEATURE_LEVEL is less than DML_FEATURE_LEVEL_4_0, then this tensor's dimensions should be { ScaleBatchCount, ChannelCount, ScaleHeight, ScaleWidth }. The dimensions ScaleBatchCount, ScaleHeight, and ScaleWidth should either match InputTensor, or be set to 1 to automatically broadcast those dimensions across the input.

If DML_FEATURE_LEVEL is greater than or equal to DML_FEATURE_LEVEL_4_0, then any dimension can be set to 1, and be automatically broadcast to match InputTensor.

If DML_FEATURE_LEVEL is less than DML_FEATURE_LEVEL_5_2, then this tensor is required if BiasTensor is present. If DML_FEATURE_LEVEL is greater than or equal to DML_FEATURE_LEVEL_5_2, then this tensor can be null regardless of the value of BiasTensor.

BiasTensor

Type: _Maybenull_ const DML_TENSOR_DESC*

An optional tensor containing the Bias data.

If DML_FEATURE_LEVEL is less than DML_FEATURE_LEVEL_4_0, then this tensor's dimensions should be { BiasBatchCount, ChannelCount, BiasHeight, BiasWidth }. The dimensions BiasBatchCount, BiasHeight, and BiasWidth should either match InputTensor, or be set to 1 to automatically broadcast those dimensions across the input.

If DML_FEATURE_LEVEL is greater than or equal to DML_FEATURE_LEVEL_4_0, then any dimension can be set to 1, and be automatically broadcast to match InputTensor.

If DML_FEATURE_LEVEL is less than DML_FEATURE_LEVEL_5_2, then this tensor is required if ScaleTensor is present. If DML_FEATURE_LEVEL is greater than or equal to DML_FEATURE_LEVEL_5_2, then this tensor can be null regardless of the value of ScaleTensor.

OutputTensor

Type: const DML_TENSOR_DESC*

A tensor to write the results to. This tensor's dimensions are { BatchCount, ChannelCount, Height, Width }.

AxisCount

Type: UINT

The number of axes. This field determines the size of the Axes array.

Axes

Type: _Field_size_(AxisCount) const UINT*

The axes along which to calculate the Mean and Variance.

UseMean

Type: BOOL

TBD

UseVariance

Type: BOOL

TBD

Epsilon

Type: FLOAT

The epsilon value to use to avoid division by zero. A value of 0.00001 is recommended as default.

FusedActivation

Type: _Maybenull_ const DML_OPERATOR_DESC*

An optional fused activation layer to apply after the normalization.

Availability

This operator was introduced in DML_FEATURE_LEVEL_6_3.

Tensor constraints

BiasTensor, InputTensor, OutputTensor, and ScaleTensor must have the same DataType and DimensionCount.

Tensor support

Tensor Kind Supported dimension counts Supported data types
InputTensor Input 1 to 8 FLOAT32, FLOAT16
ScaleTensor Optional input 1 to 8 FLOAT32, FLOAT16
BiasTensor Optional input 1 to 8 FLOAT32, FLOAT16
OutputTensor Output 1 to 8 FLOAT32, FLOAT16