Skip to content
Snippets Groups Projects
Commit 77de7e21 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Changed add_baseline_to_knobs to add knobs in order

parent 6ea1a632
No related branches found
No related tags found
No related merge requests found
......@@ -93,11 +93,10 @@ class ApproxApp(abc.ABC):
return baseline_knob
def add_baseline_to_knobs(self, approxes: KnobsT):
approxes = approxes.copy()
for op_name in self.ops:
if op_name not in approxes:
approxes[op_name] = self.baseline_knob.name
return approxes
return {
op_name: approxes.get(op_name, self.baseline_knob.name)
for op_name in self.ops
}
class BaselineKnob(ApproxKnob):
......@@ -230,7 +229,7 @@ class ApproxTuner(Generic[T]):
filepath = Path(filepath)
os.makedirs(filepath.parent, exist_ok=True)
with filepath.open("w") as f:
f.write(encode(self.kept_configs, indent=2))
f.write(encode(self.best_configs, indent=2))
def plot_configs(self) -> plt.Figure:
if not self.tuned:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment