Skip to content

Commit

Permalink
test(linear): fix gradient test
Browse files Browse the repository at this point in the history
  • Loading branch information
dacorvo committed Feb 20, 2024
1 parent f3bb422 commit a4cd3bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/nn/test_qlinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_qlinear_gradient(tokens, embeddings, activations, weights, device):
# Run an inference with identical inputs
qinputs = random_qtensor((batch_size,) + (tokens, embeddings), dtype=torch.float32).to(device)
qout = qlinear(qinputs)
out = linear(qinputs)
out = linear(qinputs.dequantize())
# Outputs are not identical because of the quantization
assert not torch.equal(qout, out)
# Compute gradients and compare
Expand Down

0 comments on commit a4cd3bb

Please sign in to comment.