code: def export_gridsample_paddingmode() -> None:
      # X shape, [N, C, H, W] - [1, 1, 3, 2]
      X = np.array(
          [[[[0.0, 1.0], [2.0, 3.0], [4.0, 5.0]]]],
          dtype=np.float32,
      )
      # Grid shape, [N, H_out, W_out, 2] - [1, 2, 4, 2]
      Grid = np.array(
          [
              [
                  [
                      [-10.0000, -10.0000],
                      [-5.0000, -5.0000],
                      [-0.2000, -0.2000],
                      [10.0000, 10.0000],
                  ],
                  [
                      [10.0000, 10.0000],
                      [-0.2000, -0.2000],
                      [5.0000, 5.0000],
                      [10.0000, 10.0000],
                  ],
              ]
          ],
          dtype=np.float32,
      )
  
      # setting padding_mode = 'zeros'
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          padding_mode="zeros",
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_zeros = np.array(
          [
              [
                  [
                      [0.0000, 0.0000, 1.7000, 0.0000],
                      [0.0000, 1.7000, 0.0000, 0.0000],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_zeros],
          name="test_gridsample_zeros_padding",
      )
  
      # setting padding_mode = 'border'
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          padding_mode="border",
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_border = np.array(
          [
              [
                  [
                      [0.0000, 0.0000, 1.7000, 5.0000],
                      [5.0000, 1.7000, 5.0000, 5.0000],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_border],
          name="test_gridsample_border_padding",
      )
  
      # setting padding_mode = 'reflection'
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          padding_mode="reflection",
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_reflection = np.array(
          [
              [
                  [
                      [2.5000, 0.0000, 1.7000, 2.5000],
                      [2.5000, 1.7000, 5.0000, 2.5000],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_reflection],
          name="test_gridsample_reflection_padding",
      )
  
file_path: onnx/onnx/backend/test/case/node/gridsample.py
imports: import numpy
  import onnx
  from onnx.backend.test.case.base import Base
  from onnx.backend.test.case.node import expect
label_desc: Use image node_id 2 for calling the GridSample obj's underlying member method code with example usage: obj.export_gridsample_paddingmode() without return types