ONE - On-device Neural Engine
Loading...
Searching...
No Matches
DumpFP32FM.DumpFP32FM Class Reference

Public Member Functions

 StartAnalysis (self, args)
 
 EndNetworkExecution (self, outputs)
 
 DefaultOpPost (self, name, opcode, inputs, outputs)
 
 EndAnalysis (self)
 

Protected Attributes

 _dir
 
 _num_data
 
 _tname_to_tid
 
 _tensor_count
 

Detailed Description

Definition at line 34 of file DumpFP32FM.py.

Member Function Documentation

◆ DefaultOpPost()

DumpFP32FM.DumpFP32FM.DefaultOpPost (   self,
  name,
  opcode,
  inputs,
  outputs 
)

Definition at line 45 of file DumpFP32FM.py.

45 def DefaultOpPost(self, name, opcode, inputs, outputs):
46 # Save intermediate FM into <tid>.npy
47 data_path = self._dir / str(self._num_data)
48 data_path.mkdir(parents=False, exist_ok=True)
49 for output in outputs:
50 name = output['name']
51 data = output['data']
52 if name in self._tname_to_tid:
53 tid = self._tname_to_tid[name]
54 else:
55 tid = self._tensor_count
56 self._tname_to_tid[name] = tid
57 self._tensor_count += 1
58
59 np.save(str(data_path / str(tid)), data)
60

References DumpFakeQuantFM.DumpFakeQuantFM._dir, DumpFP32FM.DumpFP32FM._dir, circle_eval_diff::MAEPrinter._num_data, circle_eval_diff::MSEPrinter._num_data, circle_eval_diff::MAPEPrinter._num_data, circle_eval_diff::MPEIRPrinter._num_data, circle_eval_diff::TopKMatchPrinter._num_data, record_minmax::HDF5Iterator._num_data, record_minmax::RandomIterator._num_data, DumpFakeQuantFM.DumpFakeQuantFM._num_data, DumpFP32FM.DumpFP32FM._num_data, QErrorComputer.QErrorComputer._num_data, DumpFP32FM.DumpFP32FM._tensor_count, DumpFakeQuantFM.DumpFakeQuantFM._tname_to_tid, and DumpFP32FM.DumpFP32FM._tname_to_tid.

◆ EndAnalysis()

DumpFP32FM.DumpFP32FM.EndAnalysis (   self)

Definition at line 61 of file DumpFP32FM.py.

61 def EndAnalysis(self):
62 # Save tensor name : tensor id pairs
63 with open(self._dir / 'tensors.json', 'w') as f:
64 json.dump(self._tname_to_tid, f, indent=2)

References DumpFakeQuantFM.DumpFakeQuantFM._dir, DumpFP32FM.DumpFP32FM._dir, DumpFakeQuantFM.DumpFakeQuantFM._tname_to_tid, and DumpFP32FM.DumpFP32FM._tname_to_tid.

◆ EndNetworkExecution()

◆ StartAnalysis()

DumpFP32FM.DumpFP32FM.StartAnalysis (   self,
  args 
)

Definition at line 35 of file DumpFP32FM.py.

35 def StartAnalysis(self, args):
36 self._dir = Path(args)
37 self._num_data = 0
38 # Dict {tensor_name -> tid}
39 self._tname_to_tid = dict()
40 self._tensor_count = 0
41

Field Documentation

◆ _dir

◆ _num_data

◆ _tensor_count

DumpFP32FM.DumpFP32FM._tensor_count
protected

Definition at line 40 of file DumpFP32FM.py.

Referenced by DumpFP32FM.DumpFP32FM.DefaultOpPost().

◆ _tname_to_tid

DumpFP32FM.DumpFP32FM._tname_to_tid
protected

The documentation for this class was generated from the following file: