Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix graph dict bug #77

Merged
merged 2 commits into from
Sep 8, 2022
Merged

fix graph dict bug #77

merged 2 commits into from
Sep 8, 2022

Conversation

BBuf
Copy link
Contributor

@BBuf BBuf commented Sep 8, 2022

@@ -862,9 +862,9 @@ def get_saved_tensor(self, node):
# on windows (where path separator is "\")
key = ".".join(node.output_tensor_names[0].split(".")[1:])
try:
tensor_value = self._param_dict["m"][key[:key.rfind("out")-1]].numpy().reshape(self.get_shape(tensor_name)).astype(dtype=util.Onnx2NumpyDtype(self.get_dtype(tensor_name)))
tensor_value = self._param_dict[list(self._param_dict.keys())[0]][key[:key.rfind("out")-1]].numpy().reshape(self.get_shape(tensor_name)).astype(dtype=util.Onnx2NumpyDtype(self.get_dtype(tensor_name)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个硬编码"m"只有在构造Graph的时候写self.m=xxx的时候才生效,所以这里直接取OrderedDict的keys的第一个即可。

@BBuf BBuf requested a review from oneflow-ci-bot September 8, 2022 10:13
@BBuf BBuf requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 8, 2022 11:32
@BBuf BBuf merged commit c77688b into main Sep 8, 2022
@BBuf BBuf deleted the fix_graph_dict_bug branch September 8, 2022 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants