Skip to content

Commit d2625c6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 25b46cf commit d2625c6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

op/edge_index.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
#include <iostream>
55

6-
torch::Tensor edge_index_kernel(const torch::Tensor &nlist_tensor,
7-
const torch::Tensor &atype_tensor,
8-
const torch::Tensor &mm_tensor) {
6+
torch::Tensor edge_index_kernel(const torch::Tensor& nlist_tensor,
7+
const torch::Tensor& atype_tensor,
8+
const torch::Tensor& mm_tensor) {
99
torch::Tensor nlist_tensor_ = nlist_tensor.cpu().contiguous();
1010
torch::Tensor atype_tensor_ = atype_tensor.cpu().contiguous();
1111
torch::Tensor mm_tensor_ = mm_tensor.cpu().contiguous();
@@ -33,9 +33,9 @@ torch::Tensor edge_index_kernel(const torch::Tensor &nlist_tensor,
3333
}
3434
const int64_t nall = atype_tensor_.size(1);
3535
const int64_t nmm = mm_tensor_.size(0);
36-
int64_t *nlist = nlist_tensor_.view({-1}).data_ptr<int64_t>();
37-
int64_t *atype = atype_tensor_.view({-1}).data_ptr<int64_t>();
38-
int64_t *mm = mm_tensor_.view({-1}).data_ptr<int64_t>();
36+
int64_t* nlist = nlist_tensor_.view({-1}).data_ptr<int64_t>();
37+
int64_t* atype = atype_tensor_.view({-1}).data_ptr<int64_t>();
38+
int64_t* mm = mm_tensor_.view({-1}).data_ptr<int64_t>();
3939

4040
std::vector<int64_t> edge_index;
4141
edge_index.reserve(nf * nloc * nnei * 2);

tests/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def test_forward(self) -> None:
331331
for rr in ret_lower:
332332
if rr is not None:
333333
subret.append(rr[kk])
334-
if len(subret):
334+
if subret:
335335
for ii, rr in enumerate(subret[1:]):
336336
if kk == "expanded_force":
337337
# use mapping to scatter sum the forces

0 commit comments

Comments
 (0)