code: def test_absmax_scale(input_shape, axis, dtype, itype, device):
      if device.type == "mps" and itype.is_floating_point:
          pytest.skip("Float8 are not supported on MPS device")
      a = random_tensor(input_shape, dtype=dtype).to(device)
      scale = absmax_scale(a, itype, axis)
      assert scale.dtype == dtype
      if axis is None:
          assert scale.ndim == 0
      else:
          assert scale.ndim == a.ndim
          sscale = torch.squeeze(scale)
          if a.ndim == 1 or a.shape[axis] == 1:
              # Quantization is actually per-tensor as the axis dim is 1
              assert sscale.ndim == 0
          else:
              assert sscale.ndim == 1
  
imports: import pytest
  import torch
  from helpers import random_tensor
  from quanto import absmax_scale
label_desc: Use image node_id 1 for calling a global function with example usage: test_absmax_scale(input_shape, axis, dtype, itype, device) without return types