Deep Neural Network Library (DNNL)  1.3.0
Performance library for Deep Learning
Classes | Functions

A primitive to perform tensor operations over two tensors. More...

Classes

struct  dnnl::binary
 Elementwise binary operator primitive. More...
 
struct  dnnl_binary_desc_t
 A descriptor of a binary operation. More...
 

Functions

dnnl_status_t DNNL_API dnnl_binary_desc_init (dnnl_binary_desc_t *binary_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src0_desc, const dnnl_memory_desc_t *src1_desc, const dnnl_memory_desc_t *dst_desc)
 Initializes a descriptor for a binary primitive. More...
 

Detailed Description

A primitive to perform tensor operations over two tensors.

See also
Binary in developer guide

Function Documentation

◆ dnnl_binary_desc_init()

dnnl_status_t DNNL_API dnnl_binary_desc_init ( dnnl_binary_desc_t binary_desc,
dnnl_alg_kind_t  alg_kind,
const dnnl_memory_desc_t src0_desc,
const dnnl_memory_desc_t src1_desc,
const dnnl_memory_desc_t dst_desc 
)

Initializes a descriptor for a binary primitive.

Note
Memory descriptor dst_desc is allowed to be initialized with dnnl_format_tag_any or with format_kind set to dnnl_format_kind_any.
Both memory descriptors must have the same number of dimensions. Element broadcasting is supported for memory descriptor src1_desc and are applied to @ src1_desc dimensions that have size equal to 1.

Inputs:

Outputs:

Parameters
binary_descOutput descriptor for a binary primitive.
alg_kindAlgorithm kind. Valid values are dnnl_binary_add and dnnl_binary_mul.
src0_descSource 0 memory descriptor.
src1_descSource 1 memory descriptor.
dst_descDestination memory descriptor.
Returns
dnnl_success on success and a status describing the error otherwise.