where

dragon.vm.torch.where(
  condition,
  x,
  y
)[source]

Select the elements from two branches under the condition.

\[\text{out}_{i} = \begin{cases} \text{x}_{i}, & \text{ if } \text{condition}_{i} \\ \text{y}_{i}, & \text{ otherwise } \end{cases} \]
Parameters:
Returns:

dragon.vm.torch.Tensor – The output tensor.