class_docstr: Utility class to deal with features extracted with extract_engine
  
  For multi-gpu feature extraction, each GPU saves features corresponding to its
  share of the data. This class offers an API to abstract away the loading of
  these extracted features.
class_docstr_tok: ["Utility","class","to","deal","with","features","extracted","with","extract_engine","For","multi-gpu","feature","extraction",",","each","GPU","saves","features","corresponding","to","its","share","of","the","data",".","This","class","offers","an","API","to","abstract","away","the","loading","of","these","extracted","features","."]
docstr: Get the list of files needed to load the extracted features
docstr_tok: ["Get","the","list","of","files","needed","to","load","the","extracted","features"]
code: def get_shard_file_names(
      input_dir: str,
      split: str,
      layer: str,
      sorted: bool = True,
  ) -> List[ExtractedFeaturesShardPaths]:
      """
      Get the list of files needed to load the extracted features
      """
  
      # List all the files that are containing the features for a given
      # dataset split and a given layer
      feature_regex = re.compile(rf"(.*)_{split}_{layer}_features.npy")
      prefixes = []
      for file_path in g_pathmgr.ls(input_dir):
          match = feature_regex.match(file_path)
          if match is not None:
              prefixes.append(match.group(1))
  
      # Sort the shards by file name if required: it might be useful
      # if the algorithm that uses the shards is influenced by ordering
      if sorted:
          prefixes.sort()
  
      # Yield all the files needed to merge the features dumped on
      # the different GPUs
      shard_paths = []
      for prefix in prefixes:
          feat_file = os.path.join(
              input_dir, f"{prefix}_{split}_{layer}_features.npy"
          )
          targets_file = os.path.join(
              input_dir, f"{prefix}_{split}_{layer}_targets.npy"
          )
          indices_file = os.path.join(
              input_dir, f"{prefix}_{split}_{layer}_inds.npy"
          )
          shard_paths.append(
              ExtractedFeaturesShardPaths(
                  feature_file=feat_file,
                  targets_file=targets_file,
                  indices_file=indices_file,
              )
          )
      return shard_paths
  
file_path: vissl/vissl/utils/extract_features_utils.py
imports: import logging
  import os
  import re
  from typing import List, NamedTuple
  import numpy
  from iopath.common.file_io import g_pathmgr
  from vissl.utils.io import load_file, makedir
label_desc: Use image node_id 1 for calling the ExtractedFeaturesLoader obj's underlying member method code with example usage: obj.get_shard_file_names(input_dir, split, layer, sorted) and returns: shard_paths