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

bad code show case #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

bad code show case #4

wants to merge 1 commit into from

Conversation

wenlei03
Copy link
Contributor

Try export onnx file

Try export onnx file

Signed-off-by: John <[email protected]>
@wenlei03
Copy link
Contributor Author

PR Analysis

  • 🎯 Main theme: The main theme of this PR is to add a new functionality to export a PyTorch model to ONNX format.
  • 📝 PR summary: This PR introduces a new class SubTreeExtractor and a function ddd(). The SubTreeExtractor class is a simple PyTorch model that adds two inputs. The function ddd() currently only contains a print statement. The PR also includes an example of exporting the SubTreeExtractor model to ONNX format.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 2, because the PR is relatively small and straightforward. However, it lacks proper implementation and testing.
  • 🔒 Security concerns: No

PR Feedback

  • 💡 General suggestions: The code added in this PR lacks proper implementation and testing. The function ddd() only contains a print statement and doesn't seem to serve any purpose. The SubTreeExtractor class is not properly integrated into the existing codebase. It would be better to provide a more complete implementation and add relevant tests.

def forward(self, x, y):
return x + y

torch.onnx.export(SubTreeExtractor(), (torch.Tensor(1,2,3,4), 1), "1.onnx")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The torch.onnx.export() function is used incorrectly. The second argument should be a tuple of tensors, but currently it includes an integer. [important]

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.

1 participant