Created
June 26, 2023 15:19
-
-
Save Icemole/38e03bc2bb0e96d8bc3423b7d21511aa to your computer and use it in GitHub Desktop.
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 | |
class DummyModel(torch.nn.Module): | |
def __init__(self): | |
super().__init__() | |
def forward(self, x): | |
return torch.full([x], 0) | |
dummy_model = DummyModel() | |
dummy_data = torch.tensor(1, dtype=torch.int32) | |
torch.onnx.export(dummy_model, (dummy_data,), f="my_filename.onnx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment