Skip to content

Commit 09d7847

Browse files
authored
update graph_hash.txt in OnlyModelFileRewriteSamplePassMixin (#444)
* init 'symbolic_dimension_reifier' field in graph_net.json * remove unused files * add DeviceRewriteSamplePass * fix output node order bug in torch/decompose_util.py * update graph_hash.txt in OnlyModelFileRewriteSamplePassMixin
1 parent 2afd800 commit 09d7847

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graph_net/sample_pass/only_model_file_rewrite_sample_pass_mixin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import shutil
33
from graph_net.sample_pass.sample_pass_mixin import SamplePassMixin
44
from pathlib import Path
5+
from graph_net.hash_util import get_sha256_hash
56

67

78
class OnlyModelFileRewriteSamplePassMixin(SamplePassMixin):
@@ -26,3 +27,5 @@ def copy_sample_and_handle_model_py_file(self, rel_model_path: str):
2627
shutil.copytree(src_model_path, dst_model_path, dirs_exist_ok=True)
2728
model_py_code = self.handle_model_py_file(rel_model_path)
2829
(dst_model_path / "model.py").write_text(model_py_code)
30+
file_hash = get_sha256_hash(model_py_code)
31+
(dst_model_path / "graph_hash.txt").write_text(file_hash)

0 commit comments

Comments
 (0)