code: def test_quantize_float8(input_shape, dtype, itype, device):
      a = random_tensor(input_shape, dtype=dtype).to(device)
      qa = QTensor.quantize(a, itype)
      assert isinstance(qa, QTensor)
      assert qa.dtype == dtype
      assert qa.itype == itype
      assert device_eq(qa.device, device)
      assert_similar(a, qa, atol=5e-3)
  
file_path: quanto/test/tensor/test_qtensor.py
imports: import os
  from tempfile import TemporaryDirectory
  import pytest
  import torch
  from helpers import assert_similar, device_eq, q_assert_close, random_qtensor, random_tensor
  from quanto import QTensor, absmax_scale
label_desc: Use image node_id 2 for calling a global function with example usage: test_quantize_float8(input_shape, dtype, itype, device) without return types