code: def _to_tensors(x):
      """
      Convert a nested tuple structure of arrays into a nested tuple
      structure of TF tensors
      """
      if (
          isinstance(x, dict)
          or isinstance(x, list)
          and all(isinstance(i, dict) for i in x)
      ):
          # qml.counts returns a dict (list of dicts when broadcasted), can't form a valid tensor
          return x
  
      if isinstance(x, tuple):
          return tuple(_to_tensors(x_) for x_ in x)
  
      return tf.convert_to_tensor(x)
  
file_path: pennylane/pennylane/workflow/interfaces/tensorflow.py
imports: import inspect
  import logging
  import tensorflow
  from tensorflow.python.eager import context
  import pennylane
  from pennylane.measurements import Shots
  from pennylane.transforms import convert_to_numpy_parameters
label_desc: Use image node_id 4 for calling a global function with example usage: _to_tensors(x) and returns: tf, x, tuple