code: def test_float8_scale(self, device) -> None:
      size = (16, 16)
      x = torch.full(
          size, 0.5, device=device, dtype=torch.float8_e4m3fn
      )
      y = torch.full(
          size, 0.5, device=device, dtype=torch.float8_e5m2
      ).t()
      scale_a = torch.tensor(1.5, device=device)
      scale_b = torch.tensor(0.66, device=device)
      out_fp8, amax_fp8 = torch._scaled_mm(x, y)
      self.assertEqual(
          out_fp8.to(torch.float), torch.full(size, 4.0, device=device)
      )
      out_fp8_s, amax_fp8_s = torch._scaled_mm(
          x, y, scale_a=scale_a, scale_b=scale_b
      )
      self.assertEqual(out_fp8, out_fp8_s)
  
imports: import unittest
  from itertools import product
  from functools import partial
  from typing import Optional
  import torch
  from torch.quantization._quantized_conversions import pack_int4_to_int8, quantized_weight_reorder_for_mixed_dtypes_linear_cutlass
  from torch.testing import make_tensor
  from torch.testing._internal.common_cuda import SM53OrLater, _get_torch_cuda_version
  from torch.testing._internal.common_device_type import dtypes, instantiate_device_type_tests, onlyCUDA, tol, toleranceOverride
  from torch.testing._internal.common_utils import IS_ARM64, IS_JETSON, IS_WINDOWS, parametrize, run_tests, skipIfRocmVersionLessThan, TEST_WITH_ROCM, skipIfRocm, TestCase
label_desc: Use image node_id 4 for calling the TestFP8MatmulCuda obj's underlying member method code with example usage: obj.test_float8_scale(device) without return types