class_docstr: An abstract base class for random datasets.
  
  Intended for subclassing, this class provides the framework for implementing
  custom random datasets. Each subclass should provide
  a concrete implementation of the `_generate_random_item` method.
  
  Attributes:
      size (int, default=100): The total number of items the dataset will contain.
docstr: Fetch a dataset item by index.
  
  Args:
      idx (int): Index of the desired dataset item.
  
  Returns:
      Dict[str, torch.Tensor]: Dictionary containing dataset attributes, primarily tensors.
      The exact keys depend on the implementation of `_generate_random_item`.
  
  Raises:
      IndexError: If the provided index is out of valid range.
docstr_tok: ["Fetch","a","dataset","item","by","index",".","Args",":","idx","(","int",")",":","Index","of","the","desired","dataset","item",".","Returns",":","Dict","[","str",",","torch.Tensor","]",":","Dictionary","containing","dataset","attributes",",","primarily","tensors",".","The","exact","keys","depend","on","the","implementation","of","`","_generate_random_item","`",".","Raises",":","IndexError",":","If","the","provided","index","is","out","of","valid","range","."]
code: def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]:
      """
      Fetch a dataset item by index.
  
      Args:
          idx (int): Index of the desired dataset item.
  
      Returns:
          Dict[str, torch.Tensor]: Dictionary containing dataset attributes, primarily tensors.
          The exact keys depend on the implementation of `_generate_random_item`.
  
      Raises:
          IndexError: If the provided index is out of valid range.
      """
      if 0 <= idx < self.size:
          return self._generate_random_item()
  
      raise IndexError(f"Index {idx} out of range [0, {self.size-1}]")
  
file_path: tnt/torchtnt/utils/data/synthetic_data.py
imports: from __future__ import annotations
  import abc
  import logging
  from dataclasses import dataclass, field
  from typing import Dict
  import torch
  from torch.utils.data import Dataset
  from torchtnt.utils.device import get_device_from_env
label_desc: Use image node_id 3 for calling the AbstractRandomDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self