masked_assign

dragon.masked_assign(
  inputs,
  mask,
  **kwargs
)[source]

Assign the value to ref where mask is 1.

\[\text{Ref}[i] = \begin{cases} \text{Value}[i], & \text{ if } \text{Mask}[i] = 1 \\ \text{Ref}[i], & \text{ otherwise } \end{cases} \]
Parameters:
Returns:

dragon.Tensor – The ref.