code: def __iter__(self):
      worker_info = torch.utils.data.get_worker_info()
      n_shards = self.disk_dataset.get_number_shards()
      if worker_info is None:
          process_id = 0
          num_processes = 1
      else:
          process_id = worker_info.id
          num_processes = worker_info.num_workers
  
      if dist.is_initialized():
          process_id += dist.get_rank() * num_processes
          num_processes *= dist.get_world_size()
  
      first_shard = (process_id * n_shards) // num_processes
      last_shard = ((process_id + 1) * n_shards) // num_processes
      if first_shard == last_shard:
          return
  
      shard_indices = list(range(first_shard, last_shard))
      for X, y, w, ids in self.disk_dataset._iterbatches_from_shards(
          shard_indices,
          batch_size=self.batch_size,
          epochs=self.epochs,
          deterministic=self.deterministic,
      ):
          if self.batch_size is None:
              for i in range(X.shape[0]):
                  yield (X[i], y[i], w[i], ids[i])
          else:
              yield (X, y, w, ids)
  
file_path: deepchem/deepchem/data/pytorch_datasets.py
imports: import numpy
  import torch
  import torch.distributed
  from deepchem.data.datasets import NumpyDataset, DiskDataset, ImageDataset
  from typing import Optional
label_desc: Use image node_id 3 for calling the _TorchDiskDataset obj's underlying member method code with example usage: obj.__iter__() without return types