mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE]: Enable ruff rule SIM113 (#147290)
Lint rules that tells the user to avoid keeping track of their own counter and use the builtin enumerate when possible. Pull Request resolved: https://github.com/pytorch/pytorch/pull/147290 Approved by: https://github.com/jansel
This commit is contained in:
committed by
PyTorch MergeBot
parent
a8fa4bcfd2
commit
e738f7ba23
@ -861,9 +861,8 @@ class DecisionEvaluator:
|
||||
"""
|
||||
|
||||
y_true = self.df["actual_winner"] if self.ranking else self.df["winner"]
|
||||
i = 0
|
||||
for pred, true, prob, leaf_id in zip(
|
||||
self.predictions, y_true, self.probas, self.leaf_ids
|
||||
for i, (pred, true, prob, leaf_id) in enumerate(
|
||||
zip(self.predictions, y_true, self.probas, self.leaf_ids)
|
||||
):
|
||||
avail_choices = self.df["avail_choices"].iloc[i]
|
||||
top_k_choices = self.top_k_classes(
|
||||
@ -884,7 +883,6 @@ class DecisionEvaluator:
|
||||
i,
|
||||
)
|
||||
self.eval_ranking_prediction(true, top_k_choices, i)
|
||||
i += 1
|
||||
|
||||
total = len(self.predictions)
|
||||
if return_safe_proba:
|
||||
|
Reference in New Issue
Block a user