Torchsummary AttributeError: 'int' object has no attribute 'numpy

Hello everyone, I built a simple model and I want to know the number of its parameters using torchsummary, but I got an error: “AttributeError: ‘int’ object has no attribute 'numpy”

class LinearRegression(nn.Module):
def __init__(self, in_features: int, out_features: int, bias: bool = True):
        self.weights = nn.Parameter(torch.randn((in_features,out_features),requires_grad=True))

        self.bias = bias
        if bias:            
            self.bias_term = nn.Parameter(torch.rand((out_features),requires_grad=True))
    def forward(self, x):
        x =  x@ self.weights
        if self.bias:
            x +=  self.bias_term
        return x
from torchsummary import summary
linear_regression = LinearRegression(2, 1)

Please tell me what am I doing wrong?

This seems to be a known issue in pytorch-summary and based on this issue it seems torch-summary is better maintained now.