docstr: Parameters
  ----------
  image_dataset: ImageDataset
      The original ImageDataset which you want to convert to PyTorch Dataset
  epochs: int
      the number of times to iterate over the Dataset
  deterministic: bool
      if True, the data is produced in order.  If False, a different random
      permutation of the data is used for each epoch.
  batch_size: int
      the number of samples to return in each batch.  If None, each returned
      value is a single sample.
docstr_tok: ["Parameters","--","--","--","--","--","image_dataset",":","ImageDataset","The","original","ImageDataset","which","you","want","to","convert","to","PyTorch","Dataset","epochs",":","int","the","number","of","times","to","iterate","over","the","Dataset","deterministic",":","bool","if","True",",","the","data","is","produced","in","order",".","If","False",",","a","different","random","permutation","of","the","data","is","used","for","each","epoch",".","batch_size",":","int","the","number","of","samples","to","return","in","each","batch",".","If","None",",","each","returned","value","is","a","single","sample","."]
code: def __init__(
      self,
      image_dataset: ImageDataset,
      epochs: int,
      deterministic: bool,
      batch_size: Optional[int] = None,
  ):
      """
      Parameters
      ----------
      image_dataset: ImageDataset
          The original ImageDataset which you want to convert to PyTorch Dataset
      epochs: int
          the number of times to iterate over the Dataset
      deterministic: bool
          if True, the data is produced in order.  If False, a different random
          permutation of the data is used for each epoch.
      batch_size: int
          the number of samples to return in each batch.  If None, each returned
          value is a single sample.
      """
      self.image_dataset = image_dataset
      self.epochs = epochs
      self.deterministic = deterministic
      self.batch_size = batch_size
  
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 1 to create a new _TorchImageDataset object from inherited base classes: torch.utils.data with example: obj = _TorchImageDataset(image_dataset, epochs, deterministic, batch_size)