Last active
November 28, 2018 19:56
-
-
Save wanchaol/2c48b3c61e97fda1ea61f7389d77b2ec 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
import torch | |
class Test(torch.jit.ScriptModule): | |
def __init__(self, b = None): | |
self.b = b | |
def forward(self, input): | |
x = input | |
if self.b is not None: | |
x = self.b(input) | |
return x | |
Test()(torch.randn(2, 3)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment