I cannot reproduce the issue using:
class ShiftLayer(nn.Module):
    def __init__(self, b):
        super().__init__()
        self.b = nn.Parameter(torch.tensor(1.))
        
    def forward(self, x):
        return x + self.b
    
layer = ShiftLayer(1)
out = layer(torch.randn(1))

so could you post an executable code snippet raising this issue?