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:
- condition (dragon.vm.torch.Tensor) – The condition tensor.
- x (dragon.vm.torch.Tensor) – The elements for Truebranch.
- y (dragon.vm.torch.Tensor) – The elements for Falsebranch.
 
 - Returns:
- dragon.vm.torch.Tensor – The output tensor. 
 
