From e8fc16d76bd31823e6bd33801ecf668ba13d8174 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Tue, 28 Jun 2022 05:58:14 +0000 Subject: [PATCH] update rep condition --- ppcls/engine/engine.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ppcls/engine/engine.py b/ppcls/engine/engine.py index 7df38b9a..884a05bb 100644 --- a/ppcls/engine/engine.py +++ b/ppcls/engine/engine.py @@ -465,10 +465,9 @@ class Engine(object): model.eval() # for rep nets - if "Slim" not in self.config or self.config["Slim"]["quant"]["name"] != "pact": - for layer in self.model.sublayers(): - if hasattr(layer, "rep"): - layer.rep() + for layer in self.model.sublayers(): + if hasattr(layer, "rep") and not getattr(layer, "is_repped"): + layer.rep() save_path = os.path.join(self.config["Global"]["save_inference_dir"], "inference") -- GitLab