Skip to content

Commit 7b26a00

Browse files
committed
Fix flake8 errors
1 parent 31551f1 commit 7b26a00

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

benchmarks/test_benchmark_nearest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
NEAREST_GROUPS = [1, 2, 4, 8, 16, 32]
3232
FEATURES = [8, 64, 200]
3333

34+
3435
def _assert_nearest_within_cuda(
3536
out_cuda: torch.Tensor,
3637
out_triton: torch.Tensor,

torch_cluster/triton/_kernels.py

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

44
import triton
55
import triton.language as tl
6-
from triton.language.extra import libdevice
76

87

98
def _prune_knn_configs(configs, args, **kwargs):
@@ -452,7 +451,11 @@ def _knn_segmented_kernel(
452451
padding_option="zero",
453452
)
454453
if COSINE:
455-
prod = tl.dot(x, y, input_precision=INPUT_PRECISION) # MxV dot.
454+
prod = tl.dot(
455+
x,
456+
y,
457+
input_precision=INPUT_PRECISION,
458+
) # MxV dot.
456459
acc_dot += tl.sum(prod, axis=1)
457460
acc_x_sq += tl.sum(x * x, axis=1)
458461
y_block_ptr = tl.advance(y_block_ptr, (BLOCK_D, 0))
@@ -489,7 +492,11 @@ def _knn_segmented_kernel(
489492
can_reorder=True
490493
) # Merge buffers.
491494
sorted_key = tl.sort(combo_key, descending=False) # Sort 2K keys.
492-
best_dist_key = tl.gather(sorted_key, k_offsets, axis=0) # Keep best K.
495+
best_dist_key = tl.gather(
496+
sorted_key,
497+
k_offsets,
498+
axis=0,
499+
) # Keep best K.
493500

494501
k_mask = k_offsets < K # Mask for real k.
495502
best_dist_key = tl.where(k_mask, best_dist_key, INF_KEY)

torch_cluster/triton/knn.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22
from typing import Optional
33

4-
import torch
54
from torch import Tensor
65

76
from .segmented import segmented_topk_search

torch_cluster/triton/segmented.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from typing import Optional
44

5-
import triton
65
import torch
76
from torch import Tensor
87

0 commit comments

Comments
 (0)