import math [weights](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor") = [torch.randn](https://docs.pytorch.org/docs/stable/generated/torch.randn.html#torch.randn "torch.randn")(784, 10) / math.sqrt(784) [weights](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor").requires_grad_() [bias](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor") = [torch.zeros](https://docs.pytorch.org/docs/stable/generated/torch.zeros.html#torch.zeros "torch.zeros")(10, requires_grad=True)