Nonelementwise
Nonelementwise is a term used in mathematics and computer science to describe an operation on arrays, tensors, or matrices whose output at a given position depends on more than just the elements at the corresponding positions of the inputs. In contrast, an elementwise operation applies a function independently to each element pair by pair, producing outputs that align element-for-element with the inputs.
In practice, nonelementwise operations include many core linear algebra and tensor operations. Matrix multiplication (and its
Some ordinary-looking transforms and normalizations are nonelementwise as well. For instance, softmax involves exponentiating each input
Understanding whether an operation is elementwise or nonelementwise is important for performance and differentiability, especially in