code: def test_grid_sample(self):
      n, c, h_in, w_in, h_out, w_out = 1, 1, 3, 2, 2, 4
      ops = {16: [{"op_name": "GridSample"}]}
  
      class MyModule(Module):
          def forward(self, x, grid, mode, padding_mode, align_corers):
              return torch.nn.functional.grid_sample(
                  x, grid, mode, padding_mode, align_corners
              )
  
      for mode, padding_mode, align_corners in itertools.product(
          ("bilinear", "nearest", "bicubic"),
          ("zeros", "border", "reflection"),
          (True, False),
      ):
          args = (
              torch.randn(n, c, h_in, w_in),  # x
              torch.randn(n, h_out, w_out, 2),  # grid,
              mode,
              padding_mode,
              align_corners,
          )
          check_onnx_opsets_operator(
              MyModule(),
              args,
              ops,
              opset_versions=[16],
              training=torch.onnx.TrainingMode.TRAINING,
          )
          check_onnx_opsets_operator(
              MyModule(),
              args,
              ops,
              opset_versions=[16],
              training=torch.onnx.TrainingMode.EVAL,
          )
  
imports: import io
  import itertools
  import onnx
  import pytorch_test_common
  import torch
  import torch.onnx
  from torch.nn import Module
  from torch.onnx import producer_name, producer_version
  from torch.onnx._globals import GLOBALS
  from torch.testing._internal import common_utils
label_desc: Use image node_id 11 for calling the TestONNXOpset obj's underlying member method code with example usage: obj.test_grid_sample() and returns: torch