code: def export_resize_upsample_scales_cubic() -> None:
      node = onnx.helper.make_node(
          "Resize",
          inputs=["X", "", "scales"],
          outputs=["Y"],
          mode="cubic",
      )
  
      data = np.array(
          [
              [
                  [
                      [1, 2, 3, 4],
                      [5, 6, 7, 8],
                      [9, 10, 11, 12],
                      [13, 14, 15, 16],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      scales = np.array([1.0, 1.0, 2.0, 2.0], dtype=np.float32)
  
      # [[[[ 0.47265625  0.76953125  1.24609375  1.875       2.28125
      #      2.91015625  3.38671875  3.68359375]
      #    [ 1.66015625  1.95703125  2.43359375  3.0625      3.46875
      #      4.09765625  4.57421875  4.87109375]
      #    [ 3.56640625  3.86328125  4.33984375  4.96875     5.375
      #      6.00390625  6.48046875  6.77734375]
      #    [ 6.08203125  6.37890625  6.85546875  7.484375    7.890625
      #      8.51953125  8.99609375  9.29296875]
      #    [ 7.70703125  8.00390625  8.48046875  9.109375    9.515625
      #     10.14453125 10.62109375 10.91796875]
      #    [10.22265625 10.51953125 10.99609375 11.625      12.03125
      #     12.66015625 13.13671875 13.43359375]
      #    [12.12890625 12.42578125 12.90234375 13.53125    13.9375
      #     14.56640625 15.04296875 15.33984375]
      #    [13.31640625 13.61328125 14.08984375 14.71875    15.125
      #     15.75390625 16.23046875 16.52734375]]]]
      output = interpolate_nd(
          data, lambda x, _: cubic_coeffs(x), scale_factors=scales
      ).astype(np.float32)
  
      expect(
          node,
          inputs=[data, scales],
          outputs=[output],
          name="test_resize_upsample_scales_cubic",
      )
  
imports: import numpy
  import onnx
  from onnx.backend.test.case.base import Base
  from onnx.backend.test.case.node import expect
  from onnx.reference.ops.op_resize import _cubic_coeffs
  from onnx.reference.ops.op_resize import _cubic_coeffs_antialias
  from onnx.reference.ops.op_resize import _interpolate_nd
  from onnx.reference.ops.op_resize import _linear_coeffs
  from onnx.reference.ops.op_resize import _linear_coeffs_antialias
  from onnx.reference.ops.op_resize import _nearest_coeffs
label_desc: Use image node_id 9 for calling the Resize obj's underlying member method code with example usage: obj.export_resize_upsample_scales_cubic() without return types