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: Returns unsaved layers, and deletes saved layers if load_from_disk is False.
  
  Args:
      path (str): The path where the activation vectors
              for the `layer` are stored.
      model_id (str): The name/version of the model for which layer activations
              are being computed and stored.
      layers (str or list[str]): The layer(s) for which the activation vectors
              are computed.
      load_from_disk (bool, optional): Whether or not to load from disk.
          Default: True
      identifier (str or None): An optional identifier for the layer
              activations. Can be used to distinguish between activations for
              different training batches.
      num_id (str, optional): An optional string representing the batch number
          for which the activation vectors are computed.
  
  Returns:
      List of layer names for which activations should be generated
docstr_tok: ["Returns","unsaved","layers",",","and","deletes","saved","layers","if","load_from_disk","is","False",".","Args",":","path","(","str",")",":","The","path","where","the","activation","vectors","for","the","`","layer","`","are","stored",".","model_id","(","str",")",":","The","name\/version","of","the","model","for","which","layer","activations","are","being","computed","and","stored",".","layers","(","str","or","list","[","str","]",")",":","The","layer","(","s",")","for","which","the","activation","vectors","are","computed",".","load_from_disk","(","bool",",","optional",")",":","Whether","or","not","to","load","from","disk",".","Default",":","True","identifier","(","str","or","None",")",":","An","optional","identifier","for","the","layer","activations",".","Can","be","used","to","distinguish","between","activations","for","different","training","batches",".","num_id","(","str",",","optional",")",":","An","optional","string","representing","the","batch","number","for","which","the","activation","vectors","are","computed",".","Returns",":","List","of","layer","names","for","which","activations","should","be","generated"]
code: def _manage_loading_layers(
      path: str,
      model_id: str,
      layers: Union[str, List[str]],
      load_from_disk: bool = True,
      identifier: Optional[str] = None,
      num_id: Optional[str] = None,
  ) -> List[str]:
      r"""
      Returns unsaved layers, and deletes saved layers if load_from_disk is False.
  
      Args:
          path (str): The path where the activation vectors
                  for the `layer` are stored.
          model_id (str): The name/version of the model for which layer activations
                  are being computed and stored.
          layers (str or list[str]): The layer(s) for which the activation vectors
                  are computed.
          load_from_disk (bool, optional): Whether or not to load from disk.
              Default: True
          identifier (str or None): An optional identifier for the layer
                  activations. Can be used to distinguish between activations for
                  different training batches.
          num_id (str, optional): An optional string representing the batch number
              for which the activation vectors are computed.
  
      Returns:
          List of layer names for which activations should be generated
      """
  
      layers = [layers] if isinstance(layers, str) else layers
      unsaved_layers = []
  
      if load_from_disk:
          for layer in layers:
              if not AV.exists(
                  path, model_id, identifier, layer, num_id
              ):
                  unsaved_layers.append(layer)
      else:
          unsaved_layers = layers
          warnings.warn(
              "Overwriting activations: load_from_disk is set to False. Removing all "
              f"activations matching specified parameters {{path: {path}, "
              f"model_id: {model_id}, layers: {layers}, identifier: {identifier}}} "
              "before generating new activations."
          )
          for layer in layers:
              files = glob.glob(
                  AV._construct_file_search(
                      path, model_id, identifier, layer
                  )
              )
              for filename in files:
                  os.remove(filename)
  
      return unsaved_layers
  
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 8 for calling the AV obj's underlying member method code with example usage: obj._manage_loading_layers(path, model_id, layers, load_from_disk, identifier, num_id) and returns: unsaved_layers