masked_assign

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

Assign the value to input where mask is 1.

\[\text{input}_{i} = \begin{cases} \text{value}_{i}, & \text{ if } \text{mask}_{i} = 1 \\ \text{input}_{i}, & \text{ otherwise } \end{cases} \]
Parameters:
  • inputs (Sequence[dragon.Tensor]) – The input, value and mask tensor.
Returns:

dragon.Tensor – The input tensor.