Skip to content

Commit

Permalink
Updated test to reflect changes for min/max bounds
Browse files Browse the repository at this point in the history
Signed-off-by: Priyanka Dangi <quic_pdangi@quicinc.com>
  • Loading branch information
quic-pdangi authored and neoci committed Jan 4, 2024
1 parent 3e78023 commit 8cfbb8c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_compute_encodings_with_only_zero_tensor(self):
encoding_analyzer.update_stats(torch.zeros(tuple(encoding_analyzer.observer.shape)))

asymmetric_min, asymmetric_max = encoding_analyzer.compute_encodings(bitwidth = 8, is_symmetric = False)
updated_min = torch.finfo(asymmetric_min.dtype).tiny * ((2 ** 8) - 1)
updated_min = torch.finfo(asymmetric_min.dtype).tiny * (2 ** (8 - 1))
updated_max = torch.finfo(asymmetric_min.dtype).tiny * ((2 **(8 - 1)) - 1)
assert torch.all(torch.eq(asymmetric_min, torch.full(tuple(encoding_analyzer.observer.shape), -updated_min)))
assert torch.all(torch.eq(asymmetric_max, torch.full(tuple(encoding_analyzer.observer.shape), updated_max)))
Expand Down

0 comments on commit 8cfbb8c

Please sign in to comment.