From e1d5bbe8f1b83ddc0055982e8f3930e581bcca66 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Fri, 19 Apr 2024 12:28:41 +0100 Subject: [PATCH] Fix (tests/quant_tensor): avoid 0 valued tensor --- tests/brevitas/quant_tensor/test_quant_tensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/brevitas/quant_tensor/test_quant_tensor.py b/tests/brevitas/quant_tensor/test_quant_tensor.py index 82539ae64..c7544a1f3 100644 --- a/tests/brevitas/quant_tensor/test_quant_tensor.py +++ b/tests/brevitas/quant_tensor/test_quant_tensor.py @@ -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)