Skip to content

Commit

Permalink
Fix the hash_size_cumsum cond in TBE's init (pytorch#1862)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#1862

This diff fixes `ValueError: math domain error` introduced by
D46618714

Reviewed By: q10, jianyuh, yuguo68

Differential Revision: D47236684

fbshipit-source-id: d5375928ad5ee6bad58c183355b52fac71b4b211
  • Loading branch information
sryap authored and facebook-github-bot committed Jul 6, 2023
1 parent 8c3849e commit 40d96f0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def __init__( # noqa C901
)
hash_size_cumsum = [0] + list(accumulate(rows))
self.total_hash_size: int = int(hash_size_cumsum[-1])
if hash_size_cumsum == 0:
if self.total_hash_size == 0:
self.total_hash_size_bits: int = 0
else:
self.total_hash_size_bits: int = int(log2(float(self.total_hash_size)) + 1)
Expand Down

0 comments on commit 40d96f0

Please sign in to comment.