Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN)
0.21.0
Performance library for Deep Learning
|
An extension for performing extra operations after a base operation. More...
Functions | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_create (mkldnn_post_ops_t *post_ops) |
Creates an empty sequence of post operations post_ops . More... | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_destroy (mkldnn_post_ops_t post_ops) |
Deletes a post_ops sequence. More... | |
int MKLDNN_API | mkldnn_post_ops_len (const_mkldnn_post_ops_t post_ops) |
Returns the length of post operations for given post_ops . More... | |
mkldnn_primitive_kind_t MKLDNN_API | mkldnn_post_ops_get_kind (const_mkldnn_post_ops_t post_ops, int index) |
Returns the type of post operation with index index in given post_ops . More... | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_append_sum (mkldnn_post_ops_t post_ops, float scale) |
Appends accumulation (sum) post operation to the post_ops . More... | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_get_params_sum (const_mkldnn_post_ops_t post_ops, int index, float *scale) |
Gets the parameters of the accumulation (sum) post operation with index index in the sequence of post_ops . More... | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_append_eltwise (mkldnn_post_ops_t post_ops, float scale, mkldnn_alg_kind_t alg, float alpha, float beta) |
Appends eltwise post operation to the post_ops with given parameters kind , alpha , and beta (. More... | |
mkldnn_status_t MKLDNN_API | mkldnn_post_ops_get_params_eltwise (const_mkldnn_post_ops_t post_ops, int index, float *scale, mkldnn_alg_kind_t *alg, float *alpha, float *beta) |
Gets the eltwise parameters of the post operation with index index in the sequence of post_ops . More... | |
An extension for performing extra operations after a base operation.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_create | ( | mkldnn_post_ops_t * | post_ops | ) |
Creates an empty sequence of post operations post_ops
.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_destroy | ( | mkldnn_post_ops_t | post_ops | ) |
Deletes a post_ops
sequence.
int MKLDNN_API mkldnn_post_ops_len | ( | const_mkldnn_post_ops_t | post_ops | ) |
Returns the length
of post operations for given post_ops
.
mkldnn_primitive_kind_t MKLDNN_API mkldnn_post_ops_get_kind | ( | const_mkldnn_post_ops_t | post_ops, |
int | index | ||
) |
Returns the type of post operation with index index
in given post_ops
.
In case of error, returns mkldnn_undefined_primitive.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_append_sum | ( | mkldnn_post_ops_t | post_ops, |
float | scale | ||
) |
Appends accumulation (sum) post operation to the post_ops
.
Prior to accumulating the result, the previous value would be multiplied by scale
.
The kind of this post operation is mkldnn_sum.
This feature might improve performance for cases like residual learning blocks, where the result of convolution is accumulated to the previously computed activations. The parameter scale
might be extreme for the integer-based computations when the result and previous activations have different logical scaling factors.
In the simplest case when the accumulation is the only post operation, the computations would be: dst[] <- scale * dst[] + op(...) // instead of dst[] <- op(...)
mkldnn_status_t MKLDNN_API mkldnn_post_ops_get_params_sum | ( | const_mkldnn_post_ops_t | post_ops, |
int | index, | ||
float * | scale | ||
) |
Gets the parameters of the accumulation (sum) post operation with index index
in the sequence of post_ops
.
index
would not correspond to the accumulation post operation, the function returns mkldnn_invalid_arguments. mkldnn_status_t MKLDNN_API mkldnn_post_ops_append_eltwise | ( | mkldnn_post_ops_t | post_ops, |
float | scale, | ||
mkldnn_alg_kind_t | alg, | ||
float | alpha, | ||
float | beta | ||
) |
Appends eltwise post operation to the post_ops
with given parameters kind
, alpha
, and beta
(.
The kind of this post operation is mkldnn_eltwise.
In the simplest case when the eltwise is the only post operation, the computations would be: dst[] <- scale * eltwise_op ( op(...) ) // instead of dst[] <- op(...) where eltwise_op is configured with the given parameters.
mkldnn_status_t MKLDNN_API mkldnn_post_ops_get_params_eltwise | ( | const_mkldnn_post_ops_t | post_ops, |
int | index, | ||
float * | scale, | ||
mkldnn_alg_kind_t * | alg, | ||
float * | alpha, | ||
float * | beta | ||
) |
Gets the eltwise parameters of the post operation with index index
in the sequence of post_ops
.