It works for me.
import torch
import torch.nn as nn


class A(nn.Module):
    def __init__(self):
        super(A,self).__init__()
        self.p = nn.Parameter(torch.randn(1))
        
    def forward(self):
        print(self.p.shape, self.p)
        
a = A()
a()

which prints out:
torch.Size([1]) Parameter containing:
tensor([-0.3897], requires_grad=True).