Skip to content

Commit

Permalink
fix RuntimeError: view size is not compatible with input tensor's siz…
Browse files Browse the repository at this point in the history
…e and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
  • Loading branch information
njzjz authored Nov 21, 2024
1 parent 47a160f commit 289ebac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepmd/pt/model/descriptor/se_atten.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def forward(
gg_t = torch.gather(tt_full, dim=0, index=nei_type_index)
else:
idx_i = torch.tile(
atype.view(-1, 1) * ntypes_with_padding, [1, nnei]
atype.reshape(-1, 1) * ntypes_with_padding, [1, nnei]
).view(-1)
idx_j = nei_type
# (nf x nl x nnei) x ng
Expand Down

0 comments on commit 289ebac

Please sign in to comment.