diff --git a/hpvm/projects/keras/frontend/approxhpvm_translator.py b/hpvm/projects/keras/frontend/approxhpvm_translator.py index da4464ee1b4e3dca61fd1a70a5870be651ce6187..59bc0d17c0605672153a542e850d98cf9d868d77 100644 --- a/hpvm/projects/keras/frontend/approxhpvm_translator.py +++ b/hpvm/projects/keras/frontend/approxhpvm_translator.py @@ -248,7 +248,7 @@ class TensorRtTranslator: flops = weights.shape[0] * weights.shape[1] DEBUG ("dense_flops = ", flops) - self.json_str += "\"linear_" + str(self.op_count) + "\" : " + str(flops) + "\n" + self.json_str += "\"linear_" + str(self.op_count) + "\" : " + str(flops) + ", \n" self.knobs_str += "\"linear_" + str(self.op_count) + "\" : [" + baseline_knobs + "], \n" self.op_count += 1 @@ -951,20 +951,20 @@ class TensorRtTranslator: f = open(dir_prefix + "/tuner.json", "w+") f.write("{ \n\n") - op_cost_str = " \"op_cost\" = { \n" + op_cost_str = " \"op_cost\" : { \n" op_cost_str += self.json_str[:-3] #f.write(self.json_str) - op_cost_str += "\n } \n\n" + op_cost_str += "\n }, \n\n" f.write(op_cost_str) knobs_speedup_str = "\n \"knob_speedup\" : { \n" for key in knobs_speedups: knobs_speedup_str += "\"" + str(key) + "\" : " + str(knobs_speedups[key]) + ", \n" - f.write(knobs_speedup_str[:-3] + "\n} \n\n") + f.write(knobs_speedup_str[:-3] + "\n}, \n\n") - layer_knobs_str = " \"op_knobs\" = { \n" + layer_knobs_str = " \"op_knobs\" : { \n" layer_knobs_str += self.knobs_str[:-3] layer_knobs_str += " \n\n } \n\n" f.write(layer_knobs_str)