docstr: Train/validation loaders.
docstr_tok: ["Train\/validation","loaders","."]
code: def __dataloader(self, train: bool):
      """Train/validation loaders."""
      if train:
          dataset = self.create_dataset(
              self.data_path.joinpath("train"), self.train_transform
          )
      else:
          dataset = self.create_dataset(
              self.data_path.joinpath("validation"),
              self.valid_transform,
          )
      return DataLoader(
          dataset=dataset,
          batch_size=self._batch_size,
          num_workers=self._num_workers,
          shuffle=train,
      )
  
imports: import logging
  from pathlib import Path
  from typing import Union
  import torch
  import torch.nn.functional
  from torch import nn, optim
  from torch.optim.lr_scheduler import MultiStepLR
  from torch.optim.optimizer import Optimizer
  from torch.utils.data import DataLoader
  from torchmetrics.classification import MulticlassAccuracy
  from torchvision import models
  from bigdl.nano.pytorch.vision.datasets import ImageFolder
  from bigdl.nano.pytorch.vision.transforms import transforms
  from torchvision.datasets.utils import download_and_extract_archive
  import pytorch_lightning
  from pl_examples import cli_lightning_logo
  from pytorch_lightning import LightningDataModule
  from pytorch_lightning.callbacks.finetuning import BaseFinetuning
  from pytorch_lightning.utilities import rank_zero_info
  from pytorch_lightning.utilities.cli import LightningCLI
label_desc: Use image node_id 8 for calling the CatDogImageDataModule obj's underlying member method code with example usage: obj.__dataloader(train) and returns: DataLoader