Skip to content

Commit

Permalink
Fix max_num_pairs incorrect error checking with negative max_num_pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulPPelaez committed May 11, 2023
1 parent d3578f9 commit f15d6cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchmdnet/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
self,
cutoff_lower=0.0,
cutoff_upper=5.0,
max_num_pairs=32,
max_num_pairs=-32,
return_vecs=False,
loop=False,
strategy="brute",
Expand Down Expand Up @@ -203,10 +203,10 @@ def forward(
use_periodic=self.use_periodic,
)
if self.check_errors:
if num_pairs[0] > self.max_num_pairs:
if num_pairs[0] > max_pairs:
raise RuntimeError(
"Found num_pairs({}) > max_num_pairs({})".format(
num_pairs[0], self.max_num_pairs
num_pairs[0], max_pairs
)
)
# Remove (-1,-1) pairs
Expand Down

0 comments on commit f15d6cc

Please sign in to comment.