Skip to content

Commit

Permalink
fixed type annotation errors and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ido Amos [email protected] committed Jun 26, 2024
1 parent 7d2ebbc commit 9091794
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ def __init__(

def mcc_wrapper(
self,
pred: Optional[str] = None,
target: Optional[str] = None,
sample_weight: Optional[str] = None,
pred: Union[List, np.ndarray],
target: Union[List, np.ndarray],
sample_weight: Optional[Union[List, np.ndarray, None]] = None,
**kwargs: dict,
) -> float:
"""
Expand Down Expand Up @@ -404,9 +404,9 @@ def __init__(

def balanced_acc_wrapper(
self,
pred: Optional[str] = None,
target: Optional[str] = None,
sample_weight: Optional[str] = None,
pred: Union[List, np.ndarray],
target: Union[List, np.ndarray],
sample_weight: Optional[Union[List, np.ndarray, None]] = None,
**kwargs: dict,
) -> float:
"""
Expand Down
5 changes: 1 addition & 4 deletions fuse/eval/metrics/metrics_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ def collect(self, batch: Dict) -> None:
batch_to_collect = {}

for name, key in self._keys_to_collect.items():
try:
value = batch[key]
except:
print(self._keys_to_collect)
value = batch[key]

# collect distributed
if dist.is_initialized() and self._collect_distributed:
Expand Down

0 comments on commit 9091794

Please sign in to comment.