Skip to content

Commit

Permalink
Linter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Jul 30, 2024
1 parent bd35dba commit 6556258
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bindings/python/tests/test_pt_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_serialization(self):

self.assertEqual(
out,
b'@\x00\x00\x00\x00\x00\x00\x00{"test":{"dtype":"BF16","shape":[2,2],"data_offsets":[0,8]}} \x80?\x80?\x80?\x80?'
b'@\x00\x00\x00\x00\x00\x00\x00{"test":{"dtype":"BF16","shape":[2,2],"data_offsets":[0,8]}} \x80?\x80?\x80?\x80?',
)

def test_odd_dtype(self):
Expand Down Expand Up @@ -87,10 +87,10 @@ def test_odd_dtype_fp8(self):
save_file(data, local)
reloaded = load_file(local)
# note: PyTorch doesn't implement torch.equal for float8 so we just compare the single element
self.assertEqual(data["test1"].dtype, torch.float8_e4m3fn)
self.assertEqual(data["test1"].item(), -0.5)
self.assertEqual(data["test2"].dtype, torch.float8_e5m2)
self.assertEqual(data["test2"].item(), -0.5)
self.assertEqual(reloaded["test1"].dtype, torch.float8_e4m3fn)
self.assertEqual(reloaded["test1"].item(), -0.5)
self.assertEqual(reloaded["test2"].dtype, torch.float8_e5m2)
self.assertEqual(reloaded["test2"].item(), -0.5)

def test_zero_sized(self):
data = {
Expand Down

0 comments on commit 6556258

Please sign in to comment.