curvopt-space / utils /policy.py
GirishaBuilds01's picture
Create utils/policy.py
0e8e964 verified
raw
history blame contribute delete
391 Bytes
import json
def export_policy(report, path="curvopt_policy.json"):
policy = {
r["layer"]: {
"precision": r["precision"],
"iwcs": round(r["iwcs"], 4),
"energy_saved": round(r["energy_before"] - r["energy_after"], 4)
}
for r in report
}
with open(path, "w") as f:
json.dump(policy, f, indent=2)
return path