ONE - On-device Neural Engine
Loading...
Searching...
No Matches
fmelib.DumpFMEParams Namespace Reference

Data Structures

class  DumpFMEParams
 

Functions

 _pretty_float (item, ndigits=6)
 

Function Documentation

◆ _pretty_float()

fmelib.DumpFMEParams._pretty_float (   item,
  ndigits = 6 
)
protected

Definition at line 29 of file DumpFMEParams.py.

29def _pretty_float(item, ndigits=6):
30 if isinstance(item, list):
31 return [_pretty_float(x, ndigits) for x in item]
32 if isinstance(item, float):
33 return round(item, ndigits)
34 return item
35
36
37# Dump scale parameters for FM equalization
38# The parameters are saved in the json file given as an input
39#
40# Contents of the json file ('<model_name>.fme_patterns.json')
41#
42# Before
43# [
44# {
45# “front”: <tensor_name>,
46# “back”: <tensor_name>,
47# “type”: ScaleOnly,
48# },
49# …
50# ]
51#
52# After
53# [
54# {
55# “front”: <tensor_name>,
56# “back”: <tensor_name>,
57# “type”: ScaleOnly,
58# “act_scale”: [..],
59# },
60# …
61# ]

References fmelib.DumpFMEParams._pretty_float().

Referenced by fmelib.DumpFMEParams._pretty_float(), and fmelib.DumpFMEParams.DumpFMEParams.EndAnalysis().