fn
multiply
→Tensormultiply(a: Tensor, b: Tensor | Scalar)Element-wise product.
Verbose alias of the * operator. Broadcasts a and b and
applies the standard dtype-promotion rules.
Parameters
aTensorFirst operand.
bTensor | ScalarSecond operand.
Returns
TensorElement-wise product of the broadcast shape of a and b.
Notes
Mathematical definition:
Gradients: , .
Examples
>>> import lucid
>>> a = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.multiply(a, 2.0)
Tensor([2., 4., 6.])