code: def _nested_convert_to_tensor(struct, dtype=None, name=None):
      """Eagerly converts struct to Tensor, recursing upon failure."""
      if dtype is not None or not tf.nest.is_nested(struct):
          return tf.convert_to_tensor(struct, dtype=dtype)
  
      if _maybe_convertible_to_tensor(struct):
          try:
              # Try converting the structure wholesale.
              return tf.convert_to_tensor(struct, name=name)
          except (ValueError, TypeError):
              # Unfortunately Eager/Graph mode don't agree on the error type.
              pass
      # Try converting all of its children.
      shallow_struct = _get_shallow_structure(struct)
      return nest.map_structure_up_to(
          shallow_struct,
          lambda s: _nested_convert_to_tensor(s, name=name),
          struct,
      )
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 11 for calling a global function with example usage: _nested_convert_to_tensor(struct, dtype, name) and returns: nest, tf, tf