Created
July 17, 2019 18:13
-
-
Save wanchaol/5d7fce6805ec405b1be993e17662deba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## first use case | |
inp = torch.randn(3, 3) | |
a = torch.jit.script(F.dropout) | |
a(inp) | |
## error: | |
# RuntimeError: | |
# undefined value _VF: | |
# at /scratch/wanchaol/local/pytorch/torch/nn/functional.py:800:13 | |
# second use case | |
class Test(nn.Module): | |
def __init__(self): | |
super(Test, self).__init__() | |
def forward(self, input): | |
return F.dropout(input) | |
b = torch.jit.script(Test()) | |
b(inp) | |
## works well |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment