class_docstr: The streaming dataset can be used once your data have been optimised using the DatasetOptimiser class.
class_docstr_tok: ["The","streaming","dataset","can","be","used","once","your","data","have","been","optimised","using","the","DatasetOptimiser","class","."]
code: def _validate_state_dict(self) -> None:
      assert self._state_dict
      assert self.worker_env
      assert self.cache
  
      restart_keys = sorted(self._state_dict)
      state: Dict[str, Any] = self._state_dict[restart_keys[-1]]
  
      if state["shuffle"] != self.shuffle:
          raise ValueError(
              "The provided `shuffle` state doesn't match the current one. "
              f"Found `{self.shuffle}` instead of `{state['shuffle']}`."
          )
  
      if state["num_workers"] != self.worker_env.world_size:
          raise ValueError(
              "The provided `num_workers` state doesn't match the current one. "
              f"Found `{self.worker_env.world_size}` instead of `{state['num_workers']}`."
          )
  
      if state["input_dir_path"] != self.input_dir.path:
          raise ValueError(
              "The provided `input_dir` path state doesn't match the current one. "
              f"Found `{self.input_dir.path}` instead of `{state['input_dir_path']}`."
          )
  
      if state["input_dir_url"] != self.input_dir.url:
          raise ValueError(
              "The provided `input_dir` URL state doesn't match the current one. "
              f"Found `{self.input_dir.url}` instead of `{state['input_dir_url']}`."
          )
  
      if state["seed"] != self.seed:
          raise ValueError(
              "The provided `seed` state doesn't match the current one. "
              f"Found `{self.seed}` instead of `{state['seed']}`."
          )
  
      if (
          self.item_loader
          and state["item_loader"] != self.item_loader.state_dict()
      ):
          raise ValueError(
              "The provided `item_loader` state doesn't match the current one. "
              f"Found `{self.item_loader.state_dict()}` instead of `{state['item_loader']}`."
          )
  
      if state["drop_last"] != self.drop_last:
          raise ValueError(
              "The provided `drop_last` state doesn't match the current one. "
              f"Found `{self.drop_last}` instead of `{state['drop_last']}`."
          )
  
imports: import hashlib
  import os
  from dataclasses import dataclass
  from time import time
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from torch.utils.data import IterableDataset, get_worker_info
  from lightning.data.streaming import Cache
  from lightning.data.streaming.constants import _DEFAULT_CACHE_DIR, _INDEX_FILENAME, _LIGHTNING_CLOUD_LATEST
  from lightning.data.streaming.item_loader import BaseItemLoader
  from lightning.data.streaming.sampler import ChunkedIndex
  from lightning.data.streaming.serializers import Serializer
  from lightning.data.streaming.shuffle import FullShuffle, NoShuffle, Shuffle
  from lightning.data.utilities.env import Environment, _DistributedEnv, _WorkerEnv
label_desc: Use image node_id 11 for calling the StreamingDataset obj's underlying member method code with example usage: obj._validate_state_dict() without return types