Closed ideafang closed 2 years ago
The code got TypeError when I run the examples/boston_ard.py with no bias LinearARD layers.
TypeError
examples/boston_ard.py
I changed the LinearARD in DenseModelARD to no bias:
self.l1 = nn_ard.LinearARD(input_shape, hidden_size, bias=False) self.l2 = nn_ard.LinearARD(hidden_size, output_shape, bias=False)
then, examples/boston_ard.py is failed with TypeError: unsupported operand type(s) for +=: 'Tensor' and 'NoneType
TypeError: unsupported operand type(s) for +=: 'Tensor' and 'NoneType
It may be necessary to determine whether bias=False in the line 36 and 39 of torch_ard.py
bias=False
torch_ard.py
output += self.bias ... output = F.linear(input, W) + self.bias
Thank you! Fixed
The code got
TypeError
when I run theexamples/boston_ard.py
with no bias LinearARD layers.I changed the LinearARD in DenseModelARD to no bias:
then,
examples/boston_ard.py
is failed withTypeError: unsupported operand type(s) for +=: 'Tensor' and 'NoneType
It may be necessary to determine whether
bias=False
in the line 36 and 39 oftorch_ard.py