Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2 KB

File metadata and controls

82 lines (59 loc) · 2 KB

cpp

Sum

The sum primitive sums N tensors. The variable names follow the standard conventions-label.

$$\dst(\overline{x}) = \sum\limits_{i = 1}^{N} scales(i) \cdot \src_i(\overline{x})$$

The sum primitive does not have a notion of forward or backward propagations. The backward propagation for the sum operation is simply an identity operation.

Execution Arguments

When executed, the inputs and outputs should be mapped to an execution argument index as specified by the following table.

primitive input/output execution argument index
$\src$
$\dst$

Operation Details

  • The $\dst$ memory format can be either specified by a user or derived the most appropriate one by the primitive. The recommended way is to allow the primitive to choose the appropriate format.
  • The sum primitive requires all source and destination tensors to have the same shape. Implicit broadcasting is not supported.

Post-ops and Attributes

The sum primitive does not support any post-ops or attributes.

Data Types Support

The sum primitive supports arbitrary data types for source and destination tensors.

Data Representation

Sources, Destination

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

API

dnnl::sum