class_docstr: Test the Regnet FSDP model in comparison with the DDP Regnet
  to verify that both converge to the same losses
class_docstr_tok: ["Test","the","Regnet","FSDP","model","in","comparison","with","the","DDP","Regnet","to","verify","that","both","converge","to","the","same","losses"]
code: def _read_accuracy(self, extract_dir: str, layer: str):
      print(os.listdir(extract_dir))
      targets, preds = [], []
      for file in sorted(os.listdir(extract_dir)):
          if f"test_{layer}_targets.npy" in file:
              targets.append(np.load(file))
              print(file)
          elif f"test_{layer}_predictions.npy" in file:
              preds.append(np.load(file))
              print(file)
      targets = np.squeeze(np.concatenate(targets, axis=0))
      preds = np.squeeze(np.concatenate(preds, axis=0))
      correct = (targets == preds).sum()
      accuracy = correct / targets.shape[0]
      return accuracy, preds, targets
  
imports: import os
  import unittest
  import numpy
  import torch
  from vissl.utils.checkpoint import CheckpointFormatConverter
  from vissl.utils.hydra_config import compose_hydra_configuration, convert_to_attrdict
  from vissl.utils.test_utils import gpu_test, in_temporary_directory, run_integration_test
label_desc: Use image node_id 12 for calling the TestRegnetFSDPIntegration obj's underlying member method code with example usage: obj._read_accuracy(extract_dir, layer) and returns: accuracy,  preds,  targets