Ok, then that should work for x.size() == [batch, 3] (you can remove the extra dimension in the parameters if you don’t want the batch dimension):
class Net(nn.Module):
    def __init__(self):
        super().__init__()
        self.w = nn.Parameter(torch.rand(1, 3))  # w1, w2, w3
    def forward(self, x):
        one_node = torch.sum(x * self.w, dim=-1, keepdim=True)
        return one_node * self.w.sum(dim=-1, keepdim=True)