tf.raw_ops.Case
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
An n-way switch statement which calls a single branch function.
tf.raw_ops.Case(
    branch_index, input, Tout, branches, output_shapes=[], name=None
)
An n-way switch statement, implementing the following:
```
switch (branch_index) {
  case 0:
    output = branches[0](input);
    break;
  case 1:
    output = branches[1](input);
    break;
  ...
  case [[nbranches-1]]:
  default:
    output = branches[nbranches-1](input);
    break;
}
```
| Args | 
|---|
| branch_index | A Tensorof typeint32.
The branch selector, an int32 Tensor. | 
| input | A list of Tensorobjects.
A list of input tensors passed to the branch function. | 
| Tout | A list of tf.DTypes. A list of output types. | 
| branches | A list of functions decorated with @Defun that has length >= 1.
A list of functions each of which takes 'inputs' and returns a list of
tensors, whose types are the same as what every other branch returns. | 
| output_shapes | An optional list of shapes (each a tf.TensorShapeor list ofints). Defaults to[]. | 
| name | A name for the operation (optional). | 
| Returns | 
|---|
| A list of Tensorobjects of typeTout. | 
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
  Last updated 2024-04-26 UTC.
  
  
  
    
      [null,null,["Last updated 2024-04-26 UTC."],[],[]]