Common Definitions

Contents

Common Definitions#

This section lists common types and definitions used by all or multiple primitives.

Base Class for Primitives#

struct primitive#

Base class for all computational primitives.

Subclassed by dnnl::augru_backward, dnnl::augru_forward, dnnl::batch_normalization_backward, dnnl::batch_normalization_forward, dnnl::binary, dnnl::concat, dnnl::convolution_backward_data, dnnl::convolution_backward_weights, dnnl::convolution_forward, dnnl::deconvolution_backward_data, dnnl::deconvolution_backward_weights, dnnl::deconvolution_forward, dnnl::eltwise_backward, dnnl::eltwise_forward, dnnl::gru_backward, dnnl::gru_forward, dnnl::inner_product_backward_data, dnnl::inner_product_backward_weights, dnnl::inner_product_forward, dnnl::layer_normalization_backward, dnnl::layer_normalization_forward, dnnl::lbr_augru_backward, dnnl::lbr_augru_forward, dnnl::lbr_gru_backward, dnnl::lbr_gru_forward, dnnl::lrn_backward, dnnl::lrn_forward, dnnl::lstm_backward, dnnl::lstm_forward, dnnl::matmul, dnnl::pooling_backward, dnnl::pooling_forward, dnnl::prelu_backward, dnnl::prelu_forward, dnnl::reduction, dnnl::reorder, dnnl::resampling_backward, dnnl::resampling_forward, dnnl::shuffle_backward, dnnl::shuffle_forward, dnnl::softmax_backward, dnnl::softmax_forward, dnnl::sum, dnnl::vanilla_rnn_backward, dnnl::vanilla_rnn_forward

Public Types

enum class kind#

Kinds of primitives supported by the library.

Values:

enumerator undef#

Undefined primitive.

enumerator reorder#

A reorder primitive.

enumerator shuffle#

A shuffle primitive.

enumerator concat#

A (out-of-place) tensor concatenation primitive.

enumerator sum#

A summation primitive.

enumerator convolution#

A convolution primitive.

enumerator deconvolution#

A deconvolution primitive.

enumerator eltwise#

An element-wise primitive.

enumerator softmax#

A softmax primitive.

enumerator pooling#

A pooling primitive.

enumerator prelu#

A PReLU primitive.

enumerator lrn#

An LRN primitive.

enumerator batch_normalization#

A batch normalization primitive.

enumerator layer_normalization#

A layer normalization primitive.

enumerator inner_product#

An inner product primitive.

enumerator rnn#

An RNN primitive.

enumerator binary#

A binary primitive.

enumerator matmul#

A matmul (matrix multiplication) primitive.

enumerator resampling#

A resampling primitive.

Public Functions

primitive()#

Default constructor. Constructs an empty object.

primitive(const primitive_desc_base &pd)#

Constructs a primitive from a primitive descriptor.

Parameters:

pd – Primitive descriptor.

inline kind get_kind() const#

Returns the kind of the primitive.

Returns:

The primitive kind.

void execute(const stream &astream, const std::unordered_map<int, memory> &args) const#

Executes computations specified by the primitive in a specified stream.

Arguments are passed via an arguments map containing <index, memory object> pairs. The index must be one of the DNNL_ARG_* values such as DNNL_ARG_SRC, and the memory must have a memory descriptor matching the one returned by dnnl::primitive_desc_base::query_md(query::exec_arg_md, index) unless using dynamic shapes (see DNNL_RUNTIME_DIM_VAL).

Parameters:
  • astream – Stream object. The stream must belong to the same engine as the primitive.

  • args – Arguments map.

primitive &operator=(const primitive &rhs)#

Assignment operator.

cl::sycl::event dnnl::sycl_interop::execute(const primitive &aprimitive, const stream &astream, const std::unordered_map<int, memory> &args, const std::vector<cl::sycl::event> &dependencies = {})#

Executes computations using a specified primitive object in a specified stream.

Arguments are passed via an arguments map containing <index, memory object> pairs. The index must be one of the DNNL_ARG_* values such as DNNL_ARG_SRC, and the memory must have a memory descriptor matching the one returned by dnnl::primitive_desc_base::query_md(query::exec_arg_md, index) unless using dynamic shapes (see DNNL_RUNTIME_DIM_VAL).

Parameters:
  • aprimitive – Primitive to be executed.

  • astream – Stream object. The stream must belong to the same engine as the primitive.

  • args – Arguments map.

  • dependencies – Vector of SYCL events that the execution depends on.

Returns:

SYCL event object for the specified primitive execution.

Base Class for Primitives Descriptors#

There is a common base class for primitive descriptors.

struct primitive_desc_base#

Base class for all primitive descriptors.

Subclassed by dnnl::concat::primitive_desc, dnnl::primitive_desc, dnnl::reorder::primitive_desc, dnnl::sum::primitive_desc

Public Functions

primitive_desc_base()#

Default constructor. Produces an empty object.

engine get_engine() const#

Returns the engine of the primitive descriptor.

Returns:

The engine of the primitive descriptor.

const char *impl_info_str() const#

Returns implementation name.

Returns:

The implementation name.

memory::dim query_s64(query what) const#

Returns a memory::dim value (same as int64_t).

Parameters:

what – The value to query.

Returns:

The result of the query.

memory::dims get_strides() const#

Returns strides.

Returns:

Strides.

Returns:

An empty dnnl::memory::dims if the primitive does not have a strides parameter.

memory::dims get_dilations() const#

Returns dilations.

Returns:

Dilations.

Returns:

An empty dnnl::memory::dims if the primitive does not have a dilations parameter.

memory::dims get_padding_l() const#

Returns a left padding.

Returns:

A left padding.

Returns:

An empty dnnl::memory::dims if the primitive does not have a left padding parameter.

memory::dims get_padding_r() const#

Returns a right padding.

Returns:

A right padding.

Returns:

An empty dnnl::memory::dims if the primitive does not have a right padding parameter.

float get_epsilon() const#

Returns an epsilon.

Returns:

An epsilon.

Returns:

Zero if the primitive does not have an epsilon parameter.

template<typename T = unsigned>
T get_flags() const#

Returns flags.

Template Parameters:

T – Flags enumeration type.

Returns:

Flags.

Returns:

Zero if the primitive does not have a flags parameter.

dnnl::algorithm get_algorithm() const#

Returns an algorithm kind.

Returns:

An algorithm kind.

Returns:

dnnl::algorithm::undef if the primitive does not have an algorithm parameter.

float get_alpha() const#

Returns an alpha.

Returns:

An alpha.

Returns:

Zero if the primitive does not have an alpha parameter.

float get_beta() const#

Returns a beta.

Returns:

A beta.

Returns:

Zero if the primitive does not have a beta parameter.

int get_axis() const#

Returns an axis.

Returns:

An axis.

Returns:

A negative number if the primitive does not have an axis parameter.

memory::dim get_local_size() const#

Returns an LRN local size parameter.

Returns:

An LRN local size parameter.

Returns:

Zero if the primitive does not have an LRN local size parameter.

float get_k() const#

Returns an LRN K parameter.

Returns:

An LRN K parameter.

Returns:

Zero if the primitive does not have an LRN K parameter.

float get_p() const#

Returns a reduction P parameter.

Returns:

A reduction P parameter.

Returns:

Zero if the primitive does not have a reduction P parameter.

std::vector<float> get_factors() const#

Returns a resampling factors parameters.

Returns:

A vector of factors.

Returns:

An empty vector if the primitive does not have a resampling factors parameter.

dnnl::algorithm get_cell_kind() const#

Returns an RNN cell kind parameter.

Returns:

An RNN cell kind parameter.

Returns:

dnnl::algorithm::undef if the primitive does not have an RNN cell kind parameter.

dnnl::rnn_direction get_direction() const#

Returns an RNN direction parameter.

Returns:

An RNN direction parameter.

Returns:

dnnl::rnn_direction::undef if the primitive does not have an RNN direction parameter.

dnnl::algorithm get_activation_kind() const#

Returns an RNN activation kind parameter.

Returns:

An RNN activation kind parameter.

Returns:

dnnl::algorithm::undef if the primitive does not have an RNN activation kind parameter.

memory::dims get_kernel() const#

Returns a pooling kernel parameter.

Returns:

A pooling kernel parameter.

Returns:

An empty dnnl::memory::dims if the primitive does not have a pooling kernel parameter.

memory::dim get_group_size() const#

Returns a shuffle group size parameter.

Returns:

A shuffle group size parameter.

Returns:

Zero if the primitive does not have a shuffle group size parameter.

dnnl::prop_kind get_prop_kind() const#

Returns a propagation kind.

Returns:

A propagation kind.

Returns:

dnnl::prop_kind::undef if the primitive does not have a propagation parameter.

memory::desc query_md(query what, int idx = 0) const#

Returns a memory descriptor.

Note

There are also convenience methods dnnl::primitive_desc_base::src_desc(), dnnl::primitive_desc_base::dst_desc(), and others.

Parameters:
  • what – The kind of parameter to query; can be dnnl::query::src_md, dnnl::query::dst_md, etc.

  • idx – Index of the parameter. For example, convolution bias can be queried with what = dnnl::query::weights_md and idx = 1.

Returns:

The requested memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a parameter of the specified kind or index.

memory::desc src_desc(int idx) const#

Returns a source memory descriptor.

Parameters:

idx – Source index.

Returns:

Source memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a source parameter with index pdx.

memory::desc dst_desc(int idx) const#

Returns a destination memory descriptor.

Parameters:

idx – Destination index.

Returns:

Destination memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a destination parameter with index pdx.

memory::desc bias_desc() const#

Returns the bias memory descriptor.

Returns:

The bias memory descriptor.

Returns:

A zero memory descriptor of the primitive does not have a bias parameter.

memory::desc weights_desc(int idx) const#

Returns a weights memory descriptor.

Parameters:

idx – Weights index.

Returns:

Weights memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a weights parameter with index pdx.

memory::desc diff_src_desc(int idx) const#

Returns a diff source memory descriptor.

Parameters:

idx – Diff source index.

Returns:

Diff source memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff source parameter with index pdx.

memory::desc diff_dst_desc(int idx) const#

Returns a diff destination memory descriptor.

Parameters:

idx – Diff destination index.

Returns:

Diff destination memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff destination parameter with index pdx.

memory::desc diff_weights_desc(int idx) const#

Returns a diff weights memory descriptor.

Parameters:

idx – Diff weights index.

Returns:

Diff weights memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff weights parameter with index pdx.

memory::desc src_desc() const#

Returns a source memory descriptor.

Returns:

Source memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a source parameter.

memory::desc dst_desc() const#

Returns a destination memory descriptor.

Returns:

Destination memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a destination parameter.

memory::desc weights_desc() const#

Returns a weights memory descriptor.

Returns:

Weights memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a weights parameter.

memory::desc diff_src_desc() const#

Returns a diff source memory descriptor.

Returns:

Diff source memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff source memory with.

memory::desc diff_dst_desc() const#

Returns a diff destination memory descriptor.

Returns:

Diff destination memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff destination parameter.

memory::desc diff_weights_desc() const#

Returns a diff weights memory descriptor.

Returns:

Diff weights memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff weights parameter.

memory::desc workspace_desc() const#

Returns the workspace memory descriptor.

Returns:

Workspace memory descriptor.

Returns:

A zero memory descriptor if the primitive does not require workspace parameter.

memory::desc scratchpad_desc() const#

Returns the scratchpad memory descriptor.

Returns:

scratchpad memory descriptor.

Returns:

A zero memory descriptor if the primitive does not require scratchpad parameter.

engine scratchpad_engine() const#

Returns the engine on which the scratchpad memory is located.

Returns:

The engine on which the scratchpad memory is located.

primitive_attr get_primitive_attr() const#

Returns the primitive attributes.

Returns:

The primitive attributes.

dnnl::primitive::kind get_kind() const#

Returns the kind of the primitive descriptor.

Returns:

The kind of the primitive descriptor.

It is further derived from to provide base class for all primitives.

struct primitive_desc : public dnnl::primitive_desc_base#

A base class for descriptors of all primitives that have an operation descriptor and that support iteration over multiple implementations.

Subclassed by dnnl::batch_normalization_backward::primitive_desc, dnnl::batch_normalization_forward::primitive_desc, dnnl::binary::primitive_desc, dnnl::convolution_backward_data::primitive_desc, dnnl::convolution_backward_weights::primitive_desc, dnnl::convolution_forward::primitive_desc, dnnl::deconvolution_backward_data::primitive_desc, dnnl::deconvolution_backward_weights::primitive_desc, dnnl::deconvolution_forward::primitive_desc, dnnl::eltwise_backward::primitive_desc, dnnl::eltwise_forward::primitive_desc, dnnl::inner_product_backward_data::primitive_desc, dnnl::inner_product_backward_weights::primitive_desc, dnnl::inner_product_forward::primitive_desc, dnnl::layer_normalization_backward::primitive_desc, dnnl::layer_normalization_forward::primitive_desc, dnnl::lrn_backward::primitive_desc, dnnl::lrn_forward::primitive_desc, dnnl::matmul::primitive_desc, dnnl::pooling_backward::primitive_desc, dnnl::pooling_forward::primitive_desc, dnnl::prelu_backward::primitive_desc, dnnl::prelu_forward::primitive_desc, dnnl::reduction::primitive_desc, dnnl::resampling_backward::primitive_desc, dnnl::resampling_forward::primitive_desc, dnnl::rnn_primitive_desc_base, dnnl::shuffle_backward::primitive_desc, dnnl::shuffle_forward::primitive_desc, dnnl::softmax_backward::primitive_desc, dnnl::softmax_forward::primitive_desc

Public Functions

primitive_desc()#

Default constructor. Produces an empty object.

bool next_impl()#

Advances the primitive descriptor iterator to the next implementation.

Returns:

true on success, and false if the last implementation reached, in which case primitive descriptor is not modified.

The dnnl::reorder, dnnl::sum and dnnl::concat primitives also subclass dnnl::primitive_desc to implement their primitive descriptors.

RNN primitives further subclass the dnnl::primitive_desc_base to provide utility functions for frequently queried memory descriptors.

struct rnn_primitive_desc_base : public dnnl::primitive_desc#

Base class for primitive descriptors for RNN primitives.

Subclassed by dnnl::augru_backward::primitive_desc, dnnl::augru_forward::primitive_desc, dnnl::gru_backward::primitive_desc, dnnl::gru_forward::primitive_desc, dnnl::lbr_augru_backward::primitive_desc, dnnl::lbr_augru_forward::primitive_desc, dnnl::lbr_gru_backward::primitive_desc, dnnl::lbr_gru_forward::primitive_desc, dnnl::lstm_backward::primitive_desc, dnnl::lstm_forward::primitive_desc, dnnl::vanilla_rnn_backward::primitive_desc, dnnl::vanilla_rnn_forward::primitive_desc

Public Functions

rnn_primitive_desc_base()#

Default constructor. Produces an empty object.

memory::desc src_layer_desc() const#

Returns source layer memory descriptor.

Returns:

Source layer memory descriptor.

memory::desc src_iter_desc() const#

Returns source iteration memory descriptor.

Returns:

Source iteration memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a source iteration parameter.

memory::desc src_iter_c_desc() const#

Returns source recurrent cell state memory descriptor.

Returns:

Source recurrent cell state memory descriptor.

memory::desc weights_layer_desc() const#

Returns weights layer memory descriptor.

Returns:

Weights layer memory descriptor.

memory::desc weights_iter_desc() const#

Returns weights iteration memory descriptor.

Returns:

Weights iteration memory descriptor.

memory::desc weights_peephole_desc() const#

Returns weights peephole memory descriptor.

Returns:

Weights peephole memory descriptor.

memory::desc weights_projection_desc() const#

Returns weights projection memory descriptor.

Returns:

Weights projection memory descriptor.

memory::desc augru_attention_desc() const#

Returns AUGRU attention memory descriptor.

Returns:

AUGRU attention memory descriptor.

memory::desc bias_desc() const#

Returns bias memory descriptor.

Returns:

Bias memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a bias parameter.

memory::desc dst_layer_desc() const#

Returns destination layer memory descriptor.

Returns:

Destination layer memory descriptor.

memory::desc dst_iter_desc() const#

Returns destination iteration memory descriptor.

Returns:

Destination iteration memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a destination iteration parameter.

memory::desc dst_iter_c_desc() const#

Returns destination recurrent cell state memory descriptor.

Returns:

Destination recurrent cell state memory descriptor.

memory::desc diff_src_layer_desc() const#

Returns diff source layer memory descriptor.

Returns:

Diff source layer memory descriptor.

memory::desc diff_src_iter_desc() const#

Returns diff source iteration memory descriptor.

Returns:

Diff source iteration memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff source iteration parameter.

memory::desc diff_src_iter_c_desc() const#

Returns diff source recurrent cell state memory descriptor.

Returns:

Diff source recurrent cell state memory descriptor.

memory::desc diff_weights_layer_desc() const#

Returns diff weights layer memory descriptor.

Returns:

Diff weights layer memory descriptor.

memory::desc diff_weights_iter_desc() const#

Returns diff weights iteration memory descriptor.

Returns:

Diff weights iteration memory descriptor.

memory::desc diff_weights_peephole_desc() const#

Returns diff weights peephole memory descriptor.

Returns:

Diff weights peephole memory descriptor.

memory::desc diff_weights_projection_desc() const#

Returns diff weights projection memory descriptor.

Returns:

Diff weights projection memory descriptor.

memory::desc diff_augru_attention_desc() const#

Returns diff AUGRU attention memory descriptor.

Returns:

Diff AUGRU attention memory descriptor.

memory::desc diff_bias_desc() const#

Returns diff bias memory descriptor.

Returns:

Diff bias memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff bias parameter.

memory::desc diff_dst_layer_desc() const#

Returns diff destination layer memory descriptor.

Returns:

Diff destination layer memory descriptor.

memory::desc diff_dst_iter_desc() const#

Returns diff destination iteration memory descriptor.

Returns:

Diff destination iteration memory descriptor.

Returns:

A zero memory descriptor if the primitive does not have a diff destination iteration parameter.

memory::desc diff_dst_iter_c_desc() const#

Returns diff destination recurrent cell state memory descriptor.

Returns:

Diff destination recurrent cell state memory descriptor.

Common Enumerations#

enum class dnnl::prop_kind#

Propagation kind.

Values:

enumerator undef#

Undefined propagation kind.

enumerator forward_training#

Forward data propagation (training mode). In this mode, primitives perform computations necessary for subsequent backward propagation.

enumerator forward_inference#

Forward data propagation (inference mode). In this mode, primitives perform only computations that are necessary for inference and omit computations that are necessary only for backward propagation.

enumerator forward_scoring#

Forward data propagation, alias for dnnl::prop_kind::forward_inference.

enumerator forward#

Forward data propagation, alias for dnnl::prop_kind::forward_training.

enumerator backward#

Backward propagation (with respect to all parameters).

enumerator backward_data#

Backward data propagation.

enumerator backward_weights#

Backward weights propagation.

enumerator backward_bias#

Backward bias propagation.

enum class dnnl::algorithm#

Kinds of algorithms.

Values:

enumerator undef#

Undefined algorithm.

enumerator convolution_auto#

Convolution algorithm that is chosen to be either direct or Winograd automatically

enumerator convolution_direct#

Direct convolution.

enumerator convolution_winograd#

Winograd convolution.

enumerator deconvolution_direct#

Direct deconvolution.

enumerator deconvolution_winograd#

Winograd deconvolution.

enumerator eltwise_abs#

Elementwise: abs.

enumerator eltwise_bounded_relu#

Elementwise: bounded_relu.

enumerator eltwise_clip#

Elementwise: clip.

enumerator eltwise_clip_use_dst_for_bwd#

Elementwise: clip (dst for backward)

enumerator eltwise_elu#

Elementwise: exponential linear unit (ELU)

enumerator eltwise_elu_use_dst_for_bwd#

Elementwise: exponential linear unit (ELU) (dst for backward)

enumerator eltwise_exp#

Elementwise: exponent.

enumerator eltwise_exp_use_dst_for_bwd#

Elementwise: exponent (dst for backward)

enumerator eltwise_gelu#

Elementwise: gelu alias for dnnl::algorithm::eltwise_gelu_tanh

enumerator eltwise_gelu_tanh#

Elementwise: tanh-based gelu.

enumerator eltwise_gelu_erf#

Elementwise: erf-based gelu.

enumerator eltwise_hardswish#

Elementwise: hardswish.

enumerator eltwise_hardsigmoid#

Elementwise: hardsigmoid.

enumerator eltwise_linear#

Elementwise: linear.

enumerator eltwise_log#

Elementwise: natural logarithm.

enumerator eltwise_logistic#

Elementwise: logistic.

enumerator eltwise_logistic_use_dst_for_bwd#

Elementwise: logistic (dst for backward)

enumerator eltwise_mish#

Elementwise: mish.

enumerator eltwise_pow#

Elementwise: pow.

enumerator eltwise_relu#

Elementwise: rectified linear unit (ReLU)

enumerator eltwise_relu_use_dst_for_bwd#

Elementwise: rectified linear unit (ReLU) (dst for backward)

enumerator eltwise_round#

Elementwise: round.

enumerator eltwise_soft_relu#

Elementwise: soft_relu.

enumerator eltwise_sqrt#

Elementwise: square root.

enumerator eltwise_sqrt_use_dst_for_bwd#

Elementwise: square root (dst for backward)

enumerator eltwise_square#

Elementwise: square.

enumerator eltwise_swish#

Elementwise: swish ( \(x \cdot sigmoid(a \cdot x)\))

enumerator eltwise_tanh#

Elementwise: hyperbolic tangent non-linearity (tanh)

enumerator eltwise_tanh_use_dst_for_bwd#

Elementwise: hyperbolic tangent non-linearity (tanh) (dst for backward)

enumerator lrn_across_channels#

Local response normalization (LRN) across multiple channels.

enumerator lrn_within_channel#

LRN within a single channel.

enumerator pooling_max#

Max pooling.

enumerator pooling_avg#

Average pooling exclude padding, alias for dnnl::algorithm::pooling_avg_include_padding

enumerator pooling_avg_include_padding#

Average pooling include padding.

enumerator pooling_avg_exclude_padding#

Average pooling exclude padding.

enumerator vanilla_rnn#

RNN cell.

enumerator vanilla_lstm#

LSTM cell.

enumerator vanilla_gru#

GRU cell.

enumerator lbr_gru#

GRU cell with linear before reset. Differs from original GRU in how the new memory gate is calculated: \(c_t = tanh(W_c*x_t + b_{c_x} + r_t*(U_c*h_{t-1}+b_{c_h})) \) LRB GRU expects 4 bias tensors on input: \([b_{u}, b_{r}, b_{c_x}, b_{c_h}]\)

enumerator binary_add#

Binary add.

enumerator binary_mul#

Binary mul.

enumerator binary_max#

Binary max.

enumerator binary_min#

Binary min.

enumerator binary_div#

Binary div.

enumerator binary_sub#

Binary sub.

enumerator binary_ge#

Binary greater than or equal.

enumerator binary_gt#

Binary greater than.

enumerator binary_le#

Binary less than or equal.

enumerator binary_lt#

Binary less than.

enumerator binary_eq#

Binary equal.

enumerator binary_ne#

Binary not equal.

enumerator resampling_nearest#

Nearest Neighbor resampling method.

enumerator resampling_linear#

Linear (Bilinear, Trilinear) resampling method.

enumerator reduction_max#

Reduction using max operation.

enumerator reduction_min#

Reduction using min operation.

enumerator reduction_sum#

Reduction using sum operation.

enumerator reduction_mul#

Reduction using mul operation.

enumerator reduction_mean#

Reduction using mean operation.

enumerator reduction_norm_lp_max#

Reduction using norm_lp_max operation.

enumerator reduction_norm_lp_sum#

Reduction using norm_lp_sum operation.

enumerator reduction_norm_lp_power_p_max#

Reduction using norm_lp_power_p_max operation.

enumerator reduction_norm_lp_power_p_sum#

Reduction using norm_lp_power_p_sum operation.

enumerator softmax_accurate#

Softmax, numerically stable.

enumerator softmax_log#

LogSoftmax, numerically stable.

Normalization Primitives Flags#

enum class dnnl::normalization_flags : unsigned#

Flags for normalization primitives (can be combined via ‘|’)

Values:

enumerator none#

Use no normalization flags. If specified, the library computes mean and variance on forward propagation for training and inference, outputs them on forward propagation for training, and computes the respective derivatives on backward propagation.

enumerator use_global_stats#

Use global statistics. If specified, the library uses mean and variance provided by the user as an input on forward propagation and does not compute their derivatives on backward propagation. Otherwise, the library computes mean and variance on forward propagation for training and inference, outputs them on forward propagation for training, and computes the respective derivatives on backward propagation.

enumerator use_scale#

Use scale and shift parameters. If specified, the user is expected to pass scale and shift as inputs on forward propagation. On backward propagation of type dnnl::prop_kind::backward, the library computes their derivatives. If not specified, the scale and shift parameters are not used by the library in any way.

enumerator use_shift#
enumerator fuse_norm_relu#

Fuse normalization with ReLU. On training, normalization will require the workspace to implement backward propagation. On inference, the workspace is not required and behavior is the same as when normalization is fused with ReLU using the post-ops API.

Execution argument indices#

DNNL_ARG_SRC_0#

Source argument #0.

DNNL_ARG_SRC#

A special mnemonic for source argument for primitives that have a single source. An alias for DNNL_ARG_SRC_0.

DNNL_ARG_SRC_LAYER#

A special mnemonic for RNN input vector. An alias for DNNL_ARG_SRC_0.

DNNL_ARG_FROM#

A special mnemonic for reorder source argument. An alias for DNNL_ARG_SRC_0.

DNNL_ARG_SRC_1#

Source argument #1.

DNNL_ARG_SRC_ITER#

A special mnemonic for RNN input recurrent hidden state vector. An alias for DNNL_ARG_SRC_1.

DNNL_ARG_SRC_2#

Source argument #2.

DNNL_ARG_SRC_ITER_C#

A special mnemonic for RNN input recurrent cell state vector. An alias for DNNL_ARG_SRC_2.

DNNL_ARG_DST_0#

Destination argument #0.

DNNL_ARG_DST#

A special mnemonic for destination argument for primitives that have a single destination. An alias for DNNL_ARG_DST_0.

DNNL_ARG_TO#

A special mnemonic for reorder destination argument. An alias for DNNL_ARG_DST_0.

DNNL_ARG_DST_LAYER#

A special mnemonic for RNN output vector. An alias for DNNL_ARG_DST_0.

DNNL_ARG_DST_1#

Destination argument #1.

DNNL_ARG_DST_ITER#

A special mnemonic for RNN input recurrent hidden state vector. An alias for DNNL_ARG_DST_1.

DNNL_ARG_DST_2#

Destination argument #2.

DNNL_ARG_DST_ITER_C#

A special mnemonic for LSTM output recurrent cell state vector. An alias for DNNL_ARG_DST_2.

DNNL_ARG_WEIGHTS_0#

Weights argument #0.

DNNL_ARG_WEIGHTS#

A special mnemonic for primitives that have a single weights argument. Alias for DNNL_ARG_WEIGHTS_0.

DNNL_ARG_SCALE#

Scale values argument of normalization primitives.

DNNL_ARG_SHIFT#

Shift values argument of normalization primitives.

DNNL_ARG_WEIGHTS_LAYER#

A special mnemonic for RNN weights applied to the layer input. An alias for DNNL_ARG_WEIGHTS_0.

DNNL_ARG_WEIGHTS_1#

Weights argument #1.

DNNL_ARG_WEIGHTS_ITER#

A special mnemonic for RNN weights applied to the recurrent input. An alias for DNNL_ARG_WEIGHTS_1.

DNNL_ARG_BIAS#

Bias tensor argument.

DNNL_ARG_MEAN#

Mean values tensor argument.

DNNL_ARG_VARIANCE#

Variance values tensor argument.

DNNL_ARG_WORKSPACE#

Workspace tensor argument. Workspace is used to pass information from forward propagation to backward propagation computations.

DNNL_ARG_SCRATCHPAD#

Scratchpad (temporary storage) tensor argument.

DNNL_ARG_DIFF_SRC_0#

Gradient (diff) of the source argument #0.

DNNL_ARG_DIFF_SRC#

A special mnemonic for primitives that have a single diff source argument. An alias for DNNL_ARG_DIFF_SRC_0.

DNNL_ARG_DIFF_SRC_LAYER#

A special mnemonic for gradient (diff) of RNN input vector. An alias for DNNL_ARG_DIFF_SRC_0.

DNNL_ARG_DIFF_SRC_1#

Gradient (diff) of the source argument #1.

DNNL_ARG_DIFF_SRC_ITER#

A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector. An alias for DNNL_ARG_DIFF_SRC_1.

DNNL_ARG_DIFF_SRC_2#

Gradient (diff) of the source argument #2.

DNNL_ARG_DIFF_SRC_ITER_C#

A special mnemonic for gradient (diff) of RNN input recurrent cell state vector. An alias for DNNL_ARG_DIFF_SRC_1.

DNNL_ARG_DIFF_DST_0#

Gradient (diff) of the destination argument #0.

DNNL_ARG_DIFF_DST#

A special mnemonic for primitives that have a single diff destination argument. An alias for DNNL_ARG_DIFF_DST_0.

DNNL_ARG_DIFF_DST_LAYER#

A special mnemonic for gradient (diff) of RNN output vector. An alias for DNNL_ARG_DIFF_DST_0.

DNNL_ARG_DIFF_DST_1#

Gradient (diff) of the destination argument #1.

DNNL_ARG_DIFF_DST_ITER#

A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector. An alias for DNNL_ARG_DIFF_DST_1.

DNNL_ARG_DIFF_DST_2#

Gradient (diff) of the destination argument #2.

DNNL_ARG_DIFF_DST_ITER_C#

A special mnemonic for gradient (diff) of RNN input recurrent cell state vector. An alias for DNNL_ARG_DIFF_DST_2.

DNNL_ARG_DIFF_WEIGHTS_0#

Gradient (diff) of the weights argument #0.

DNNL_ARG_DIFF_WEIGHTS#

A special mnemonic for primitives that have a single diff weights argument. Alias for DNNL_ARG_DIFF_WEIGHTS_0.

DNNL_ARG_DIFF_SCALE#

Scale gradient argument of normalization primitives.

DNNL_ARG_DIFF_SHIFT#

Shift gradient argument of normalization primitives.

DNNL_ARG_DIFF_WEIGHTS_LAYER#

A special mnemonic for diff of RNN weights applied to the layer input. An alias for DNNL_ARG_DIFF_WEIGHTS_0.

DNNL_ARG_DIFF_WEIGHTS_1#

Gradient (diff) of the weights argument #1.

DNNL_ARG_DIFF_WEIGHTS_ITER#

A special mnemonic for diff of RNN weights applied to the recurrent input. An alias for DNNL_ARG_DIFF_WEIGHTS_1.

DNNL_ARG_DIFF_BIAS#

Gradient (diff) of the bias tensor argument.

DNNL_ARG_MULTIPLE_SRC#

Starting index for source arguments for primitives that take a variable number of source arguments.

DNNL_ARG_MULTIPLE_DST#

Starting index for destination arguments for primitives that produce a variable number of destination arguments.

DNNL_ARG_ATTR_SCALES#

Scaling factors provided at execution time.

DNNL_ARG_ATTR_ZERO_POINTS#

Zero points provided at execution time.

DNNL_RUNTIME_DIM_VAL#

A wildcard value for dimensions that are unknown at a primitive creation time.

DNNL_RUNTIME_SIZE_VAL#

A size_t counterpart of the DNNL_RUNTIME_DIM_VAL. For instance, this value is returned by dnnl::memory::desc::get_size() if either of the dimensions or strides equal to DNNL_RUNTIME_DIM_VAL.

DNNL_RUNTIME_F32_VAL#

A wildcard value for floating point values that are unknown at a primitive creation time.

DNNL_RUNTIME_S32_VAL#

A wildcard value for int32_t values that are unknown at a primitive creation time.