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`, *optional*):
          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","`",",","*","optional","*",")",":","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","."]
code: def _get_is_as_tensor_fns(
      self, tensor_type: Optional[Union[str, TensorType]] = None
  ):
      if tensor_type is None:
          return None, None
  
      # 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  # noqa
  
          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:
  
          def as_tensor(value, dtype=None):
              if isinstance(value, (list, tuple)) and isinstance(
                  value[0], (list, tuple, np.ndarray)
              ):
                  value_lens = [len(val) for val in value]
                  if len(set(value_lens)) > 1 and dtype is None:
                      # we have a ragged list so handle explicitly
                      value = as_tensor(
                          [np.asarray(val) for val in value],
                          dtype=object,
                      )
              return np.asarray(value, dtype=dtype)
  
          is_tensor = is_numpy_array
      return is_tensor, as_tensor
  
imports: import copy
  import json
  import os
  import warnings
  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, add_model_info_to_auto_map, 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, is_torch_dtype, logging, requires_backends
label_desc: Use image node_id 9 for calling the BatchFeature obj's underlying member method code with example usage: obj._get_is_as_tensor_fns(tensor_type) and returns: is_tensor,  as_tensor, None,  None, torch, np