Since weight seems to be undefined, replace it with either torch.empty or torch.randn with the desired shapes and make sure the dtype (float32 by default) and the device is as expected.
Also, note that Variables are deprecated since PyTorch 0.4, so you can use tensors now.