class_docstr: Holds the output of the [`~SequenceFeatureExtractor.pad`] and feature extractor specific `__call__` methods.
  
  This class is derived from a python dictionary and can be used as a dictionary.
  
  Args:
      data (`dict`):
          Dictionary of lists/arrays/tensors returned by the __call__/pad methods ('input_values', 'attention_mask',
          etc.).
      tensor_type (`Union[None, str, TensorType]`, *optional*):
          You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
          initialization.
class_docstr_tok: ["Holds","the","output","of","the","[","`","~SequenceFeatureExtractor.pad","`","]","and","feature","extractor","specific","`","__call__","`","methods",".","This","class","is","derived","from","a","python","dictionary","and","can","be","used","as","a","dictionary",".","Args",":","data","(","`","dict","`",")",":","Dictionary","of","lists\/arrays\/tensors","returned","by","the","__call__\/pad","methods","(","'input_values","'",",","'attention_mask","'",",","etc.",")",".","tensor_type","(","`","Union","[","None",",","str",",","TensorType","]","`",",","*","optional","*",")",":","You","can","give","a","tensor_type","here","to","convert","the","lists","of","integers","in","PyTorch\/TensorFlow\/Numpy","Tensors","at","initialization","."]
docstr: Convert the inner content to tensors.
  
  Args:
      tensor_type (`str` or [`~utils.TensorType`], *optional*):
          The type of tensors to use. If `str`, should be one of the values of the enum [`~utils.TensorType`]. If
          `None`, no modification is done.
docstr_tok: ["Convert","the","inner","content","to","tensors",".","Args",":","tensor_type","(","`","str","`","or","[","`","~utils.TensorType","`","]",",","*","optional","*",")",":","The","type","of","tensors","to","use",".","If","`","str","`",",","should","be","one","of","the","values","of","the","enum","[","`","~utils.TensorType","`","]",".","If","`","None","`",",","no","modification","is","done","."]
code: def convert_to_tensors(
      self, tensor_type: Optional[Union[str, TensorType]] = None
  ):
      """
      Convert the inner content to tensors.
  
      Args:
          tensor_type (`str` or [`~utils.TensorType`], *optional*):
              The type of tensors to use. If `str`, should be one of the values of the enum [`~utils.TensorType`]. If
              `None`, no modification is done.
      """
      if tensor_type is None:
          return self
  
      # Convert to TensorType
      if not isinstance(tensor_type, TensorType):
          tensor_type = TensorType(tensor_type)
  
      # Get a function reference for the correct framework
      if tensor_type == TensorType.TENSORFLOW:
          if not is_tf_available():
              raise ImportError(
                  "Unable to convert output to TensorFlow tensors format, TensorFlow is not installed."
              )
          import tensorflow as tf
  
          as_tensor = tf.constant
          is_tensor = tf.is_tensor
      elif tensor_type == TensorType.PYTORCH:
          if not is_torch_available():
              raise ImportError(
                  "Unable to convert output to PyTorch tensors format, PyTorch is not installed."
              )
          import torch
  
          def as_tensor(value):
              if (
                  isinstance(value, (list, tuple))
                  and len(value) > 0
                  and isinstance(value[0], np.ndarray)
              ):
                  value = np.array(value)
              return torch.tensor(value)
  
          is_tensor = torch.is_tensor
      elif tensor_type == TensorType.JAX:
          if not is_flax_available():
              raise ImportError(
                  "Unable to convert output to JAX tensors format, JAX is not installed."
              )
          import jax.numpy as jnp  # noqa: F811
  
          as_tensor = jnp.array
          is_tensor = is_jax_tensor
      else:
          as_tensor = np.asarray
          is_tensor = is_numpy_array
  
      # Do the tensor conversion in batch
      for key, value in self.items():
          try:
              if not is_tensor(value):
                  tensor = as_tensor(value)
  
                  self[key] = tensor
          except:  # noqa E722
              if key == "overflowing_values":
                  raise ValueError(
                      "Unable to create tensor returning overflowing values of different lengths. "
                  )
              raise ValueError(
                  "Unable to create tensor, you should probably activate padding "
                  "with 'padding=True' to have batched tensors with the same length."
              )
  
      return self
  
imports: import copy
  import json
  import os
  from collections import UserDict
  from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
  import numpy
  from .dynamic_module_utils import custom_object_save
  from .utils import FEATURE_EXTRACTOR_NAME, PushToHubMixin, TensorType, cached_file, copy_func, download_url, is_flax_available, is_jax_tensor, is_numpy_array, is_offline_mode, is_remote_url, is_tf_available, is_torch_available, is_torch_device, logging, torch_required
label_desc: Use image node_id 9 for calling the BatchFeature obj's underlying member method code with example usage: obj.convert_to_tensors(tensor_type) and returns: self, self, torch