Skip to content

Commit e535aca

Browse files
Update sbi/inference/posteriors/ensemble_posterior.py
Co-authored-by: Jan <[email protected]>
1 parent 66b4386 commit e535aca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sbi/inference/posteriors/ensemble_posterior.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def weights(self, weights: Optional[Union[List[float], Tensor]]) -> None:
137137
self._weights = torch.tensor([
138138
1.0 / self.num_components for _ in range(self.num_components)
139139
])
140-
elif isinstance(weights, Tensor) or isinstance(weights, List):
140+
elif isinstance(weights, (Tensor, List)):
141141
self._weights = torch.tensor(weights) / sum(weights)
142142
else:
143143
raise TypeError

0 commit comments

Comments
 (0)