Skip to content

Commit aefd3b5

Browse files
committed
fix ut
1 parent af9b980 commit aefd3b5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

deepmd/pt/model/network/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ def aggregate(
3939
bin_count = torch.cat([bin_count, bin_count.new_ones(difference)])
4040
else:
4141
num_owner = bin_count.shape[0]
42+
else:
43+
bin_count = None
4244

4345
output = data.new_zeros([num_owner, data.shape[1]])
4446
output = output.index_add_(0, owners, data)
4547
if average:
48+
assert bin_count is not None
4649
output = (output.T / bin_count).T
4750
return output
4851

0 commit comments

Comments
 (0)