Skip to content

Commit

Permalink
Added eps
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanhoy committed Sep 18, 2023
1 parent a4e97fe commit ee4487a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torchsig/transforms/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,10 @@ def quantize(
"""
# Setup quantization resolution/bins
max_value = max(np.abs(np.real(np.copy(tensor)),np.imag(np.copy(tensor)))) + 1e-9
max_value = (
max(np.abs(np.real(np.copy(tensor)), np.imag(np.copy(tensor))))
+ np.finfo(np.dtype(np.float64)).eps
)
bins = np.linspace(-max_value, max_value, num_levels + 1)

# Digitize to bins
Expand Down

0 comments on commit ee4487a

Please sign in to comment.