Skip to content

Commit

Permalink
Sarthaks suggestion for code coverage
Browse files Browse the repository at this point in the history
Co-authored-by: Sarthak Pati <[email protected]>
  • Loading branch information
FelixSteinbauer and sarthakpati authored Aug 1, 2023
1 parent 6d1b3fb commit 67b9d72
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions GANDLF/cli/generate_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ def __percentile_clip(input_tensor, reference_tensor=None, p_min=0.5, p_max=99.5
Returns:
torch.Tensor: The input_tensor normalized based on the percentiles of the reference tensor.
"""
if(reference_tensor == None):
reference_tensor = input_tensor
reference_tensor = input_tensor if reference_tensor is None else reference_tensor
v_min, v_max = np.percentile(reference_tensor, [p_min,p_max]) #get p_min percentile and p_max percentile

if( v_min < 0 and strictlyPositive): #set lower bound to be 0 if it would be below
Expand Down

0 comments on commit 67b9d72

Please sign in to comment.