Last active
January 16, 2024 17:57
-
-
Save justinchuby/0cf5ec03a0beb1ce3cb6aa5cb24bf06f to your computer and use it in GitHub Desktop.
Test PyTorch ONNX export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import onnx | |
class Model(torch.nn.Module): | |
def forward(self, x): | |
return torch.nn.functional.hardsigmoid(x) | |
exported = torch.onnx.dynamo_export(Model(), torch.randn(1, 3, 224, 224)) | |
print(onnx.printer.to_text(exported.model_proto)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment