Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 5, 2024
1 parent 3fa47e0 commit a6314ec
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions torch_geometric/utils/_negative_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ def negative_sampling(
warnings.warn(
'The probability of sampling a negative edge is too low! '
'It could be that the number of sampled edges is smaller '
'than the numbers you required!'
)
'than the numbers you required!')

guess_edge_index, guess_edge_id = sample_almost_k_edges(
size, k, force_undirected=force_undirected,
Expand Down Expand Up @@ -303,10 +302,8 @@ def structured_negative_sampling(
neg_col[ok_edges] = col_to_save.view(-1)

if not torch.all(ok_edges):
raise ValueError(
'Sparse method was not able to sample '
'all negative edges requested!'
)
raise ValueError('Sparse method was not able to sample '
'all negative edges requested!')

else:
guess_col, guess_edge_id = sample_k_structured_edges(
Expand Down

0 comments on commit a6314ec

Please sign in to comment.