class_docstr: This class provides functionality to store and load activation vectors
  generated for pre-defined neural network layers.
  It also provides functionality to check if activation vectors already
  exist in the manifold and other auxiliary functions.
  
  This class also defines a torch `Dataset`, representing Activation Vectors,
  which enables lazy access to activation vectors and layer stored in the manifold.
class_docstr_tok: ["This","class","provides","functionality","to","store","and","load","activation","vectors","generated","for","pre-defined","neural","network","layers",".","It","also","provides","functionality","to","check","if","activation","vectors","already","exist","in","the","manifold","and","other","auxiliary","functions",".","This","class","also","defines","a","torch","`","Dataset","`",",","representing","Activation","Vectors",",","which","enables","lazy","access","to","activation","vectors","and","layer","stored","in","the","manifold","."]
docstr: Verifies whether the model + layer activations exist
  under the path.
  
  Args:
      path (str): The path where the activation vectors
              for the `model_id` are stored.
      model_id (str): The name/version of the model for which layer activations
              are being computed and stored.
      identifier (str or None): An optional identifier for the layer activations.
              Can be used to distinguish between activations for different
              training batches. For example, the id could be a suffix composed of
              a train/test label and numerical value, such as "-train-xxxxx".
              The numerical id is often a monotonic sequence taken from datetime.
      layer (str or None): The layer for which the activation vectors are
              computed.
      num_id (str): An optional string representing the batch number for which
              the activation vectors are computed
  
  Returns:
      exists (bool): Indicating whether the activation vectors for the `layer`
              and `identifier` (if provided) and num_id (if provided) were stored
              in the manifold. If no `identifier` is provided, will return `True`
              if any layer activation exists, whether it has an identifier or
              not, and vice-versa.
docstr_tok: ["Verifies","whether","the","model","+","layer","activations","exist","under","the","path",".","Args",":","path","(","str",")",":","The","path","where","the","activation","vectors","for","the","`","model_id","`","are","stored",".","model_id","(","str",")",":","The","name\/version","of","the","model","for","which","layer","activations","are","being","computed","and","stored",".","identifier","(","str","or","None",")",":","An","optional","identifier","for","the","layer","activations",".","Can","be","used","to","distinguish","between","activations","for","different","training","batches",".","For","example",",","the","id","could","be","a","suffix","composed","of","a","train\/test","label","and","numerical","value",",","such","as","``","-train-xxxxx","''",".","The","numerical","id","is","often","a","monotonic","sequence","taken","from","datetime",".","layer","(","str","or","None",")",":","The","layer","for","which","the","activation","vectors","are","computed",".","num_id","(","str",")",":","An","optional","string","representing","the","batch","number","for","which","the","activation","vectors","are","computed","Returns",":","exists","(","bool",")",":","Indicating","whether","the","activation","vectors","for","the","`","layer","`","and","`","identifier","`","(","if","provided",")","and","num_id","(","if","provided",")","were","stored","in","the","manifold",".","If","no","`","identifier","`","is","provided",",","will","return","`","True","`","if","any","layer","activation","exists",",","whether","it","has","an","identifier","or","not",",","and","vice-versa","."]
code: def exists(
      path: str,
      model_id: str,
      identifier: Optional[str] = None,
      layer: Optional[str] = None,
      num_id: Optional[str] = None,
  ) -> bool:
      r"""
      Verifies whether the model + layer activations exist
      under the path.
  
      Args:
          path (str): The path where the activation vectors
                  for the `model_id` are stored.
          model_id (str): The name/version of the model for which layer activations
                  are being computed and stored.
          identifier (str or None): An optional identifier for the layer activations.
                  Can be used to distinguish between activations for different
                  training batches. For example, the id could be a suffix composed of
                  a train/test label and numerical value, such as "-train-xxxxx".
                  The numerical id is often a monotonic sequence taken from datetime.
          layer (str or None): The layer for which the activation vectors are
                  computed.
          num_id (str): An optional string representing the batch number for which
                  the activation vectors are computed
  
      Returns:
          exists (bool): Indicating whether the activation vectors for the `layer`
                  and `identifier` (if provided) and num_id (if provided) were stored
                  in the manifold. If no `identifier` is provided, will return `True`
                  if any layer activation exists, whether it has an identifier or
                  not, and vice-versa.
      """
      av_dir = AV._assemble_model_dir(path, model_id)
      av_filesearch = AV._construct_file_search(
          path, model_id, identifier, layer, num_id
      )
      return (
          os.path.exists(av_dir) and len(glob.glob(av_filesearch)) > 0
      )
  
imports: import glob
  import os
  import re
  import warnings
  from typing import Any, List, Optional, Tuple, Union
  import captum._utils.common
  import torch
  from captum.attr import LayerActivation
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 5 for calling the AV obj's underlying member method code with example usage: obj.exists(path, model_id, identifier, layer, num_id) and returns: unknown