mxnet

An extension for performing extra operations after a base operation.
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_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 integerbased 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_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.
mkldnn_primitive_kind_t MKLDNN_API mkldnn_post_ops_get_kind  (  const_mkldnn_post_ops_t  post_ops, 
int  index  
) 
Returns the kind 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_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
.
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. int MKLDNN_API mkldnn_post_ops_len  (  const_mkldnn_post_ops_t  post_ops  ) 
Returns the length
of post operations for given post_ops
.