# tensorflow::ops::Where3

`#include <math_ops.h>`

Selects elements from `x` or `y`, depending on `condition`.

## Summary

The `x`, and `y` tensors must all have the same shape, and the output will also have that shape.

The `condition` tensor must be a scalar if `x` and `y` are scalars. If `x` and `y` are vectors or higher rank, then `condition` must be either a scalar, a vector with size matching the first dimension of `x`, or must have the same shape as `x`.

The `condition` tensor acts as a mask that chooses, based on the value at each element, whether the corresponding element / row in the output should be taken from `x` (if true) or `y` (if false).

If `condition` is a vector and `x` and `y` are higher rank matrices, then it chooses which row (outer dimension) to copy from `x` and `y`. If `condition` has the same shape as `x` and `y`, then it chooses which element to copy from `x` and `y`.

For example:


```
# 'condition' tensor is [[True,  False]
#                        [False, True]]
# 't' is [[1, 2],
#         [3, 4]]
# 'e' is [[5, 6],
#         [7, 8]]
select(condition, t, e)  # => [[1, 6], [7, 4]]
```

<br />


```
# 'condition' tensor is [True, False]
# 't' is [[1, 2],
#         [3, 4]]
# 'e' is [[5, 6],
#         [7, 8]]
select(condition, t, e) ==> [[1, 2],
                             [7, 8]]
```

<br />


````
  
  Arguments:
      
- scope: A https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope object

      
- x: = A `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor` which may have the same shape as `condition`. If `condition` is rank 1, `x` may have higher rank, but its first dimension must match the size of `condition`.

      
- y: = A `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor` with the same type and shape as `x`.

    

  Returns:
      
- `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`: = A `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor` with the same type and shape as `x` and `y`. 

    

                                


        
### Constructors and Destructors


      



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1a1e043e7f8493b555a94d106084a64a32(const ::https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input condition, ::https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x, ::https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input y)`
        

      


                                                          


        
### Public attributes


      



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1a9b749e1046fbe4c39075a2b037391cf2`
      

        
          `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation`
        
      



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1a07742c7ad2705b0fa9b9cc9e59eca41b`
      

        
          `::https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`
        
      


                                                                              


        
### Public functions


      



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1aacfd2a5bd041b46bc2179d3e9ac5c0c6() const `
      

        
          `::tensorflow::Node *`
        
      



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1a7fcabeeb211b239288d028b587a88e54() const `
      

        
          `
        ``
      `



        `https://www.tensorflow.org/versions/r2.0/api_docs/cc/class/tensorflow/ops/where3#classtensorflow_1_1ops_1_1_where3_1aedd6e529c7127af0c5af333ded627ab3() const `
      

        
          `
        ``
      `


  Public attributes
  
    
### operation


    
```
Operation operation
```

    
  
  
    
### output


    
```
::tensorflow::Output output
```

    
  
  Public functions
  
    
### Where3


    
```
 Where3(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input condition,
  ::tensorflow::Input x,
  ::tensorflow::Input y
)
```

    
  
  
    
### node


    
```
::tensorflow::Node * node() const 
```

    
  
  
    
### operator::tensorflow::Input


    
```
 operator::tensorflow::Input() const 
```

    
  
  
    
### operator::tensorflow::Output


    
```
 operator::tensorflow::Output() const 
```

    
  

  

  
````