Skip to content

Commit

Permalink
Integrate comment of passive aggressive reviewer
Browse files Browse the repository at this point in the history
  • Loading branch information
aleximmer committed Dec 10, 2021
1 parent d37f26b commit 5ee4009
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion laplace/baselaplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,11 @@ def fit(self, train_loader, override=True):

X, _ = next(iter(train_loader))
with torch.no_grad():
self.n_outputs = self.model(X[:1].to(self._device)).shape[-1]
try:
out = self.model(X[:1].to(self._device))
except (TypeError, AttributeError):
out = self.model(X.to(self._device))
self.n_outputs = out.shape[-1]
setattr(self.model, 'output_size', self.n_outputs)

eigenvectors, eigenvalues, loss = self.backend.eig_lowrank(train_loader)
Expand Down

0 comments on commit 5ee4009

Please sign in to comment.