docstr: Export the results of the sensitivity analysis
  to a csv file. The firstline of the csv file describe the content
  structure. The first line is constructed by 'layername' and sparsity
  list. Each line below records the validation metric returned by val_func
  when this layer is under different sparsities. Note that, due to the early_stop
  option, some layers may not have the metrics under all sparsities.
  
  layername, 0.25, 0.5, 0.75
  conv1, 0.6, 0.55
  conv2, 0.61, 0.57, 0.56
  
  Parameters
  ----------
  filepath : str
      Path of the output file
docstr_tok: ["Export","the","results","of","the","sensitivity","analysis","to","a","csv","file",".","The","firstline","of","the","csv","file","describe","the","content","structure",".","The","first","line","is","constructed","by","'layername","'","and","sparsity","list",".","Each","line","below","records","the","validation","metric","returned","by","val_func","when","this","layer","is","under","different","sparsities",".","Note","that",",","due","to","the","early_stop","option",",","some","layers","may","not","have","the","metrics","under","all","sparsities",".","layername",",","0.25",",","0.5",",","0.75","conv1",",","0.6",",","0.55","conv2",",","0.61",",","0.57",",","0.56","Parameters","--","--","--","--","--","filepath",":","str","Path","of","the","output","file"]
code: def export(self, filepath):
      """
      Export the results of the sensitivity analysis
      to a csv file. The firstline of the csv file describe the content
      structure. The first line is constructed by 'layername' and sparsity
      list. Each line below records the validation metric returned by val_func
      when this layer is under different sparsities. Note that, due to the early_stop
      option, some layers may not have the metrics under all sparsities.
  
      layername, 0.25, 0.5, 0.75
      conv1, 0.6, 0.55
      conv2, 0.61, 0.57, 0.56
  
      Parameters
      ----------
      filepath : str
          Path of the output file
      """
      str_sparsities = [str(x) for x in self.sparsities]
      header = ["layername"] + str_sparsities
      with open(filepath, "w") as csvf:
          csv_w = csv.writer(csvf)
          csv_w.writerow(header)
          for layername in self.sensitivities:
              row = []
              row.append(layername)
              for sparsity in sorted(
                  self.sensitivities[layername].keys()
              ):
                  row.append(self.sensitivities[layername][sparsity])
              csv_w.writerow(row)
  
file_path: auptimizer/src/aup/compression/torch/utils/sensitivity_analysis.py
imports: import copy
  import csv
  import logging
  from collections import OrderedDict
  import numpy
  import torch.nn
label_desc: Use image node_id 6 for calling the SensitivityAnalysis obj's underlying member method code with example usage: obj.export(filepath) without return types