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: Send all values to device by calling `v.to(device)` (PyTorch only).
  
  Args:
      device (`str` or `torch.device`): The device to put the tensors on.
  
  Returns:
      [`BatchFeature`]: The same instance after modification.
docstr_tok: ["Send","all","values","to","device","by","calling","`","v.to","(","device",")","`","(","PyTorch","only",")",".","Args",":","device","(","`","str","`","or","`","torch.device","`",")",":","The","device","to","put","the","tensors","on",".","Returns",":","[","`","BatchFeature","`","]",":","The","same","instance","after","modification","."]
code: def to(self, device: Union[str, "torch.device"]) -> "BatchFeature":
      """
      Send all values to device by calling `v.to(device)` (PyTorch only).
  
      Args:
          device (`str` or `torch.device`): The device to put the tensors on.
  
      Returns:
          [`BatchFeature`]: The same instance after modification.
      """
  
      # This check catches things like APEX blindly calling "to" on all inputs to a module
      # Otherwise it passes the casts down and casts the LongTensor containing the token idxs
      # into a HalfTensor
      if (
          isinstance(device, str)
          or is_torch_device(device)
          or isinstance(device, int)
      ):
          self.data = {
              k: v.to(device=device) for k, v in self.data.items()
          }
      else:
          logger.warning(
              f"Attempting to cast a BatchFeature to type {str(device)}. This is not supported."
          )
      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 10 for calling the BatchFeature obj's underlying member method code with example usage: obj.to(device) and returns: self