Skip to content

Commit

Permalink
Fix (tests/quant_tensor): avoid 0 valued tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Apr 19, 2024
1 parent cd121c3 commit 253ac7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/brevitas/quant_tensor/test_quant_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def test_quant_tensor_init():
@pytest.mark.parametrize(
'op', [Operator.ADD, Operator.SUBTRACT, Operator.DIVIDE, Operator.MULTIPLY, Operator.MATMUL])
def test_quant_tensor_operators(op):
x = torch.randn(4, 4)
# Avoid 0 values
x = 1 + torch.rand(4, 4)

a = torch.Tensor(x)
b = torch.Tensor(x)
Expand Down

0 comments on commit 253ac7b

Please sign in to comment.