docstr: Accept np.ndarray, torch.Tensor, list, or dictionary. Recursively convert any ndarrays to
  tensors and call .to() on any tensors or data types that have custom serialization logic
  defined via a callable to() attribute.
  
  If the data cannot be moved to device, log a warning (only once per type) and return the
  original data.
code: def to_device(
      self,
      data: pytorch._Data,
      warned_types: Optional[Set[Type]] = None,
  ) -> pytorch.TorchData:
      """
      Accept np.ndarray, torch.Tensor, list, or dictionary. Recursively convert any ndarrays to
      tensors and call .to() on any tensors or data types that have custom serialization logic
      defined via a callable to() attribute.
  
      If the data cannot be moved to device, log a warning (only once per type) and return the
      original data.
      """
      return pytorch.to_device(data, self.device, warned_types)
  
imports: import abc
  import json
  import logging
  import math
  import os
  import pathlib
  import uuid
  import warnings
  from typing import TYPE_CHECKING, Any, ContextManager, Dict, Optional, Set, Sized, Type
  import torch
  import torch.distributed
  from torch import nn
  from torch.utils import data
  import determined
  from determined import common, core, pytorch
label_desc: Use image node_id 3 for calling the TorchBatchProcessorContext obj's underlying member method code with example usage: obj.to_device(data, warned_types) and returns: pytorch