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{cond}[i] \text{ is True } \\ \text{y}[i], & \text{ otherwise } \end{cases} \]
Parameters:
Returns:

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