diff --git a/mlcolvar/core/transform/descriptors/pairwise_distances.py b/mlcolvar/core/transform/descriptors/pairwise_distances.py index 8520cf2b..b0da75ff 100644 --- a/mlcolvar/core/transform/descriptors/pairwise_distances.py +++ b/mlcolvar/core/transform/descriptors/pairwise_distances.py @@ -38,7 +38,10 @@ def __init__(self, torch.Tensor Non duplicated pairwise distances between all the atoms """ - super().__init__(in_features=int(n_atoms*3), out_features=int(n_atoms*(n_atoms-1) / 2)) + if slicing_pairs is None: + super().__init__(in_features=int(n_atoms*3), out_features=int(n_atoms*(n_atoms-1) / 2)) + else: + super().__init__(in_features=int(n_atoms*3), out_features=len(slicing_pairs)) # parse args self.n_atoms = n_atoms