class_docstr: Metric used to sample random images.
  
  Only images in strategy.adapted dataset are used. Images added in the
  dataloader (like the replay plugins do) are missed.
  By default data augmentation are removed.
  
  :param n_rows: The numbers of raws to use in the grid of images.
  :param n_cols: The numbers of columns to use in the grid of images.
  :param group: If True, images will be grouped by (task, label)
  :param mode: The plugin can be used at train or eval time.
  :param disable_augmentations: determines whether to show the augmented
      images or the raw images (default: True).
  :return: The corresponding plugins.
class_docstr_tok: ["Metric","used","to","sample","random","images",".","Only","images","in","strategy.adapted","dataset","are","used",".","Images","added","in","the","dataloader","(","like","the","replay","plugins","do",")","are","missed",".","By","default","data","augmentation","are","removed",".",":","param","n_rows",":","The","numbers","of","raws","to","use","in","the","grid","of","images",".",":","param","n_cols",":","The","numbers","of","columns","to","use","in","the","grid","of","images",".",":","param","group",":","If","True",",","images","will","be","grouped","by","(","task",",","label",")",":","param","mode",":","The","plugin","can","be","used","at","train","or","eval","time",".",":","param","disable_augmentations",":","determines","whether","to","show","the","augmented","images","or","the","raw","images","(","default",":","True",")",".",":","return",":","The","corresponding","plugins","."]
code: def after_train_dataset_adaptation(
      self, strategy: "SupervisedTemplate"
  ) -> "MetricResult":
      if self.mode == "train" or self.mode == "both":
          return self._make_grid_sample(strategy)
      return None
  
imports: from typing import List, TYPE_CHECKING, Tuple
  from torch import Tensor
  from torch.utils.data import DataLoader
  from torchvision.transforms import ToTensor
  from torchvision.utils import make_grid
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.evaluation.metric_definitions import PluginMetric
  from avalanche.evaluation.metric_results import MetricResult, TensorImage, MetricValue
  from avalanche.evaluation.metric_utils import get_metric_name
  from typing_extensions import Literal
label_desc: Use image node_id 2 for calling the ImagesSamplePlugin obj's underlying member method code with example usage: obj.after_train_dataset_adaptation(strategy) and returns: None, self