Deep Neural Network Library (DNNL)  1.2.0
Performance library for Deep Learning
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Binary

API Reference

The binary primitive computes an operation between source 0 and source 1 element-wise:

\[ dst(\overline{x}) = src0(\overline{x}) \mathbin{op} src1(\overline{x}), \]

where \(op\) is addition or multiplication.

The binary primitive does not have a notion of forward or backward propagations.

Implementation Details

General Notes

Post-ops and Attributes

The following attributes are supported:

Type Operation Restrictions Description
Attribute Scales The corresponding tensor has integer data type. Only one scale per tensor is supported. Input tensors only. Scales the corresponding input tensor by the given scale factor(s).

Data Types Support

The source and destination tensors may have f32, bf16, or int8 data types. See Data Types page for more details.

Data Representation

Sources, Destination

The binary primitive works with arbitrary data tensors. There is no special meaning associated with any of tensors dimensions.

Implementation Limitations

  1. Refer to Data Types for limitations related to data types support.

Performance Tips

  1. Whenever possible, avoid specifying different memory formats for source tensors.