Created
July 19, 2018 21:00
-
-
Save jamesr66a/f3cddce667b22898113ce0be3a2ec3f1 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 ClampMod(torch.nn.Module): | |
def forward(self, x): | |
return x.clamp(max=3.14, min=4.13) | |
import io | |
f = io.BytesIO() | |
m = ClampMod() | |
torch.onnx.export(m, (torch.rand(3),), f, verbose=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment