Skip to content

Commit

Permalink
opt env
Browse files Browse the repository at this point in the history
  • Loading branch information
GGBond8488 authored and chenyaowen02 committed Jan 17, 2024
1 parent 0ebfa25 commit 36a6b3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions padiff/cinn_diff/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ def run_model(self, run_env, log):

def run_base_model(self):
self.init_base_env()
root_path = os.getcwd()
os.chdir(self.script_path)
run_env = self.base_env.copy()
logger.info(run_env)
run_env.update(self.os_env)
base_log = open("base.log", "w")
self.run_model(run_env, base_log)
base_log.close()
os.chdir(root_path)

def run_cinn_model(self):
self.init_cinn_env()
root_path = os.getcwd()
os.chdir(self.script_path)
run_env = self.cinn_env.copy()
base_env = self.base_env.copy()
Expand All @@ -110,3 +113,4 @@ def run_cinn_model(self):
cinn_log = open("cinn.log", "w")
self.run_model(run_env, cinn_log)
cinn_log.close()
os.chdir(root_path)

0 comments on commit 36a6b3b

Please sign in to comment.