original_docstring: Converts values in `stats` to non-Tensor numpy or python types.
  
      Args:
          stats (any): Any (possibly nested) struct, the values in which will be
              converted and returned as a new struct with all tf (eager) tensors
              being converted to numpy types.
  
      Returns:
          Any: A new struct with the same structure as `stats`, but with all
              values converted to non-tf Tensor types.
      
docstring: Converts values in `stats` to non-Tensor numpy or python types.
docstring_tokens: Converts values in ` stats ` to non - Tensor numpy or python types .
code: def convert_to_non_tf_type(stats):
      """Converts values in `stats` to non-Tensor numpy or python types.
  
      Args:
          stats (any): Any (possibly nested) struct, the values in which will be
              converted and returned as a new struct with all tf (eager) tensors
              being converted to numpy types.
  
      Returns:
          Any: A new struct with the same structure as `stats`, but with all
              values converted to non-tf Tensor types.
      """
  
      # The mapping function used to numpyize torch Tensors.
      def mapping(item):
          if isinstance(item, (tf.Tensor, tf.Variable)):
              return item.numpy()
          else:
              return item
  
      return tree.map_structure(mapping, stats)
code_tokens: def convert_to_non_tf_type ( stats ) : def mapping ( item ) : if isinstance ( item , ( tf . Tensor , tf . Variable ) ) : return item . numpy ( ) else : return item return tree . map_structure ( mapping , stats )
short_docstring: Converts values in `stats` to non-Tensor numpy or python types.
short_docstring_tokens: Converts values in ` stats ` to non - Tensor numpy or python types .
comment: """Converts values in `stats` to non-Tensor numpy or python types.
  
      Args:
          stats (any): Any (possibly nested) struct, the values in which will be
              converted and returned as a new struct with all tf (eager) tensors
              being converted to numpy types.
  
      Returns:
          Any: A new struct with the same structure as `stats`, but with all
              values converted to non-tf Tensor types.
      """$SEP$# The mapping function used to numpyize torch Tensors.