Created
June 13, 2019 14:53
-
-
Save hereismari/a30ea03066a9dc5c45c613624595447b 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
def test_execute_plan_module_remotely(hook, start_proc): | |
"""Test plan execution remotely.""" | |
hook.local_worker.is_client_worker = False | |
class Net(nn.Module): | |
def __init__(self): | |
super(Net, self).__init__() | |
self.fc1 = nn.Linear(2, 3) | |
self.fc2 = nn.Linear(3, 2) | |
@sy.method2plan | |
def forward(self, x): | |
x = F.relu(self.fc1(x)) | |
x = self.fc2(x) | |
return F.log_softmax(x, dim=0) | |
net = Net() | |
x = th.tensor([-1, 2.0]) | |
local_res = net(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment