Skip to content

Commit

Permalink
fix dump_kmodel_desc.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 committed Aug 30, 2023
1 parent f20a300 commit 6473b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run_inference(self, compiler, target, ptq_enabled, infer_dir):
kmodel = compiler.gencode_tobytes()
os.makedirs(infer_dir, exist_ok=True)
if self.dynamic:
dump_kmodel_desc(os.path.join(infer_dir, self.cfg['desc_name']))
self.dump_kmodel_desc(os.path.join(infer_dir, self.cfg['desc_name']))
if not in_ci:
with open(os.path.join(infer_dir, self.cfg['kmodel_name']), 'wb') as f:
f.write(kmodel)
Expand Down Expand Up @@ -77,7 +77,7 @@ def set_infer_input(self, sim, compile_opt):

sim.set_input_tensor(idx, nncase.RuntimeTensor.from_numpy(data))

def dump_kmodel_desc(file):
def dump_kmodel_desc(self, file):
input_shapes = data_shape_list_string(self.inputs)
output_shapes = data_shape_list_string(self.outputs)
s = f"{len(self.inputs)} {len(self.outputs)}\n{input_shapes}\n{output_shapes}"
Expand Down

0 comments on commit 6473b35

Please sign in to comment.