In-place elementwise multiplication: writes back into a.
Math
See Also
mul_op — out-of-place counterpart.
Parameters
aTensorImplPtrLeft operand and in-place target. Must be non-null and must not share storage with a view.
bTensorImplPtrRight operand. Must be non-null and broadcastable into
a->shape().Returns
TensorImplPtrThe same pointer as a, now holding the product storage.
Raises
ShapeMismatchIf the broadcast output would change
a's shape.RuntimeErrorIf
a shares storage with a view.Notes
Common usage: scaling gradients (grad_.mul_(scale)) or applying
element-wise masks (out_.mul_(mask)) without allocating a new
buffer per step.