Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hejunchao committed Sep 26, 2023
1 parent 5fc61f2 commit 5d20abb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/compare_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@


def cosine(gt: np.ndarray, pred: np.ndarray, *args):
# gt = np.reshape(gt,-1)
# pred = np.reshape(pred,-1)
# for i in range(gt.size):
# print(gt[i])
# print()
# for i in range(pred.size):
# print(pred[i])

# remove the NaN values in the same location.
if np.isnan(gt).any() and np.isnan(pred).any():
Expand All @@ -53,7 +46,7 @@ def cosine(gt: np.ndarray, pred: np.ndarray, *args):
if np.isnan(gt).any() or np.isnan(pred).any() or np.isinf(gt).any() or np.isinf(pred).any():
return -1

# exclude the situation of all zeros in ndarray.
# exclude the situation of all zeros in array.
if compare_arrays(gt, pred):
return 1

Expand Down

0 comments on commit 5d20abb

Please sign in to comment.