Implementing kernel
C++ engine symbols that back this Python API.Element-wise addition with broadcasting and dtype promotion.
Computes input + other element-wise. Scalars are promoted to a tensor of matching dtype; tensors with different shapes are broadcast following the standard rules. Mixed-dtype operands are promoted to their common type prior to the operation.
Parameters
Returns
TensorElement-wise result with shape broadcast(input.shape, other.shape) and
dtype determined by the usual type-promotion rules.
Notes
Mathematical definition:
Autograd: gradient flows back to both operands as the identity (, ), with broadcasted dimensions summed.
Examples
>>> import lucid
>>> a = lucid.tensor([1.0, 2.0, 3.0])
>>> b = lucid.tensor([4.0, 5.0, 6.0])
>>> lucid.add(a, b)
Tensor([...])