class_docstr: Adapter that handles `torch.utils.data.DataLoader`.
class_docstr_tok: ["Adapter","that","handles","`","torch.utils.data.DataLoader","`","."]
code: def __init__(self, dataloader):
      import torch
  
      if not isinstance(dataloader, torch.utils.data.DataLoader):
          raise ValueError(
              f"Expected argument `dataloader` to be an instance of"
              f"`torch.utils.data.DataLoader`. Received: {dataloader}"
          )
  
      self._dataloader = dataloader
      self._batch_size = dataloader.batch_size
      self._size = len(dataloader)
      self._partial_batch_size = (
          len(dataloader.dataset) % self._batch_size
      )
  
file_path: keras/keras/trainers/data_adapters/torch_data_loader_adapter.py
imports: import numpy
  import tree
  from keras.trainers.data_adapters.data_adapter import DataAdapter
label_desc: Use image node_id 1 to create a new TorchDataLoaderAdapter object from inherited base classes: DataAdapter with example: obj = TorchDataLoaderAdapter(dataloader)