code: def export_volumeetric_gridsample_mode_aligncorners() -> None:
      X = np.array(
          [
              [
                  [
                      [[1.0, 2.0], [3.0, 4.0]],
                      [[5.0, 6.0], [7.0, 8.0]],
                      [[9.0, 10.0], [11.0, 12.0]],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      Grid = np.array(
          [
              [
                  [
                      [[-1.0, -1.0, -1.0], [-1.0, -0.5, 0.3]],
                      [[-0.5, -0.5, -0.5], [1.0, -0.6, -1.0]],
                      [[-0.2, -0.2, -0.2], [0.4, 0.2, 0.6]],
                      [[0.0, 0.0, 0.0], [-1.0, 0.0, 0.0]],
                  ],
                  [
                      [[0.0, 0.0, 0.0], [-1.0, 1.0, 0.0]],
                      [[-0.2, -0.2, -0.2], [1.0, 0.4, -0.2]],
                      [[0.5, 0.5, 0.5], [-1.0, -0.8, 0.8]],
                      [[1.0, 1.0, 1.0], [0.4, 0.6, -0.3]],
                  ],
              ]
          ],
          dtype=np.float32,
      )
  
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          mode="nearest",
          align_corners=0,
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_nearest = np.array(
          [
              [
                  [
                      [[1.0, 5.0], [1.0, 0.0], [5.0, 12.0], [5.0, 5.0]],
                      [[5.0, 0.0], [5.0, 0.0], [12.0, 9.0], [0.0, 8.0]],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_nearest],
          name="test_gridsample_volumetric_nearest_align_corners_0",
      )
  
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          mode="nearest",
          align_corners=1,
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_nearest = np.array(
          [
              [
                  [
                      [[1.0, 5.0], [1.0, 2.0], [5.0, 12.0], [5.0, 5.0]],
                      [
                          [5.0, 7.0],
                          [5.0, 8.0],
                          [12.0, 9.0],
                          [12.0, 8.0],
                      ],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_nearest],
          name="test_gridsample_volumetric_nearest_align_corners_1",
      )
  
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          mode="linear",
          align_corners=0,
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_bilinear = np.array(
          [
              [
                  [
                      [
                          [0.1250, 3.4000],
                          [2.0000, 0.4500],
                          [4.7000, 10.9000],
                          [6.5000, 3.0000],
                      ],
                      [
                          [6.5000, 1.7500],
                          [4.7000, 3.3000],
                          [11.0000, 2.5200],
                          [1.5000, 5.4900],
                      ],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_bilinear],
          name="test_gridsample_volumetric_bilinear_align_corners_0",
      )
  
      node = onnx.helper.make_node(
          "GridSample",
          inputs=["X", "Grid"],
          outputs=["Y"],
          mode="linear",
          align_corners=1,
      )
      # Y shape, [N, C, H_out, W_out] - [1, 1, 2, 4]
      Y_bilinear = np.array(
          [
              [
                  [
                      [
                          [1.0000, 6.7000],
                          [3.7500, 2.4000],
                          [5.4000, 9.3000],
                          [6.5000, 6.0000],
                      ],
                      [
                          [6.5000, 7.0000],
                          [5.4000, 6.6000],
                          [9.2500, 8.4000],
                          [12.0000, 6.1000],
                      ],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      expect(
          node,
          inputs=[X, Grid],
          outputs=[Y_bilinear],
          name="test_gridsample_volumetric_bilinear_align_corners_1",
      )
  
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 4 for calling the GridSample obj's underlying member method code with example usage: obj.export_volumeetric_gridsample_mode_aligncorners() without return types