struct dnnl_eltwise_desc_t

Overview

A descriptor of a element-wise operation. More…

#include <dnnl_types.h>

struct dnnl_eltwise_desc_t
{
    // fields

    dnnl_primitive_kind_t primitive_kind;
    dnnl_prop_kind_t prop_kind;
    dnnl_alg_kind_t alg_kind;
    dnnl_memory_desc_t data_desc;
    dnnl_memory_desc_t diff_data_desc;
    float alpha;
    float beta;
};

Detailed Documentation

A descriptor of a element-wise operation.

Fields

dnnl_primitive_kind_t primitive_kind

The kind of primitive.

Used for self-identifying the primitive descriptor. Must be dnnl_eltwise.

dnnl_prop_kind_t prop_kind

The kind of propagation.

Possible values: dnnl_forward_training, dnnl_forward_inference, dnnl_backward, and dnnl_backward_data.

dnnl_alg_kind_t alg_kind

The kind of eltwise algorithm.

Possible values: dnnl_eltwise_relu, dnnl_eltwise_tanh, dnnl_eltwise_elu, dnnl_eltwise_square, dnnl_eltwise_abs, dnnl_eltwise_sqrt, dnnl_eltwise_linear, dnnl_eltwise_bounded_relu, dnnl_eltwise_soft_relu, dnnl_eltwise_logistic, dnnl_eltwise_exp, dnnl_eltwise_gelu_tanh, dnnl_eltwise_swish, dnnl_eltwise_log, dnnl_eltwise_clip, dnnl_eltwise_clip_v2, dnnl_eltwise_pow, dnnl_eltwise_gelu_erf, dnnl_eltwise_round, dnnl_eltwise_logsigmoid, dnnl_eltwise_mish, dnnl_eltwise_hardswish. Possible values for passing destination memory on backward: dnnl_eltwise_relu_use_dst_for_bwd, dnnl_eltwise_tanh_use_dst_for_bwd, dnnl_eltwise_elu_use_dst_for_bwd, dnnl_eltwise_sqrt_use_dst_for_bwd, dnnl_eltwise_logistic_use_dst_for_bwd, dnnl_eltwise_exp_use_dst_for_bwd, dnnl_eltwise_clip_v2_use_dst_for_bwd.

dnnl_memory_desc_t data_desc

Source and destination memory descriptor.

dnnl_memory_desc_t diff_data_desc

Source and destination gradient memory descriptor.

float alpha

Algorithm specific parameter.

Accordance table: