tff.structure.map_structure
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Applies fn to each entry in structure and returns a new structure.
tff.structure.map_structure(
    fn: Callable[..., object], *structures
) -> object
This is a special implementation of tf.nest.map_structure
that works for Struct.
| Args | 
|---|
| fn | a callable that accepts as many arguments as there are structures. | 
| *structures | a scalar, tuple, or list of constructed scalars and/or
tuples/lists, or scalars. Note: numpy arrays are considered scalars. | 
| Returns | 
|---|
| A new structure with the same arity as structureand same type asstructure[0], whose values correspond tofn(x[0], x[1], ...)wherex[i]is a value in the corresponding location instructure[i]. | 
| Raises | 
|---|
| TypeError | if fnis not a callable, or *structure is not allStructor
alltf.Tensortyped values. | 
| ValueError | if *structureis empty. | 
  
  
 
  
    
    
      
       
    
    
  
  
  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.
  Last updated 2024-09-20 UTC.
  
  
  
    
      [null,null,["Last updated 2024-09-20 UTC."],[],[]]