code: def test_qbitstensor_serialization(itype, axis):
      a = random_tensor((5, 5), dtype=torch.float32)
      qa = QBitsTensor.quantize(a, itype=itype, axis=axis)
      b = io.BytesIO()
      torch.save(qa, b)
      b.seek(0)
      qa_reloaded = torch.load(b)
      assert isinstance(qa_reloaded, QBitsTensor)
      assert qa_reloaded.itype == qa.itype
      assert qa_reloaded.dtype == qa.dtype
      assert torch.equal(qa_reloaded._data, qa._data)
      assert torch.equal(qa_reloaded._scale, qa._scale)
      assert torch.equal(qa_reloaded._zeropoint, qa._zeropoint)
  
file_path: quanto/test/tensor/test_qbitstensor.py
imports: import io
  import pytest
  import torch
  from helpers import device_eq, q_assert_close, random_tensor
  from quanto import QBitsTensor, int2, int4
label_desc: Use image node_id 4 for calling a global function with example usage: test_qbitstensor_serialization(itype, axis) without return types