Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)  0.17
Performance library for Deep Learning
Functions

A primitive to compute element wise operations like parametric rectifier linear unit (ReLU). More...

Functions

mkldnn_status_t MKLDNN_API mkldnn_eltwise_forward_desc_init (mkldnn_eltwise_desc_t *eltwise_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *data_desc, float alpha, float beta)
 Initializes a eltwise_desc for forward propagation using prop_kind (possible values are mkldnn_forward_training or mkldnn_forward_inference), alg_kind algorithm, memory descriptor data_desc, and alpha, beta parameters. More...
 
mkldnn_status_t MKLDNN_API mkldnn_eltwise_backward_desc_init (mkldnn_eltwise_desc_t *eltwise_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_data_desc, const mkldnn_memory_desc_t *data_desc, float alpha, float beta)
 Initializes a eltwise_desc for backward propagation using alg_kind algorithm memory descriptors diff_data_desc and data_desc, and alpha, beta parameters. More...
 

Detailed Description

A primitive to compute element wise operations like parametric rectifier linear unit (ReLU).

Both forward and backward passes support in-place operation, i.e. src and dst point to the same memory for forward, and diff_dst and diff_src point to the same memory for backward pass.

Warning
Since for backward pass original src is required, in-place forward pass in general cannot be applied during training. However for some kinds of element wise operations (namely ReLU with alpha parameter equals 0) dst and src can be interchangeable for the backward pass, which allows performing in-place forward even for training.

Function Documentation

◆ mkldnn_eltwise_forward_desc_init()

mkldnn_status_t MKLDNN_API mkldnn_eltwise_forward_desc_init ( mkldnn_eltwise_desc_t eltwise_desc,
mkldnn_prop_kind_t  prop_kind,
mkldnn_alg_kind_t  alg_kind,
const mkldnn_memory_desc_t data_desc,
float  alpha,
float  beta 
)

Initializes a eltwise_desc for forward propagation using prop_kind (possible values are mkldnn_forward_training or mkldnn_forward_inference), alg_kind algorithm, memory descriptor data_desc, and alpha, beta parameters.

See also
mkldnn_eltwise_desc_t for details

Order of inputs:

Order of outputs:

◆ mkldnn_eltwise_backward_desc_init()

mkldnn_status_t MKLDNN_API mkldnn_eltwise_backward_desc_init ( mkldnn_eltwise_desc_t eltwise_desc,
mkldnn_alg_kind_t  alg_kind,
const mkldnn_memory_desc_t diff_data_desc,
const mkldnn_memory_desc_t data_desc,
float  alpha,
float  beta 
)

Initializes a eltwise_desc for backward propagation using alg_kind algorithm memory descriptors diff_data_desc and data_desc, and alpha, beta parameters.

See also
mkldnn_eltwise_desc_t for details

Order of inputs:

Order of outputs: