code: def data_input_to_tensor(structure: Any) -> Any:
      """
      Converts non-tensor elements of a structure to TensorFlow tensors retaining the structure
      itself.
  
      The function doesn't keep original element's dtype and forcefully converts
      them to GPflow's default float type.
      """
  
      def convert_to_tensor(elem: Any) -> tf.Tensor:
          if tf.is_tensor(elem):
              return elem
          elif isinstance(elem, np.ndarray):
              return tf.convert_to_tensor(elem)
          return tf.convert_to_tensor(elem, dtype=default_float())
  
      return tf.nest.map_structure(convert_to_tensor, structure)
  
file_path: GPflow/gpflow/models/util.py
imports: from typing import Any, Callable, Sequence, Union
  import numpy
  import tensorflow
  from check_shapes import check_shapes
  from ..base import AnyNDArray
  from ..config import default_float
  from ..inducing_variables import InducingPoints, InducingVariables
  from .model import BayesianModel
  from .training_mixins import Data, ExternalDataTrainingLossMixin
label_desc: Use image node_id 6 for calling a global function with example usage: data_input_to_tensor(structure) and returns: tf, tf, elem, tf