Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement