code: def test_script_2d(
      self, input_param, image_shape, feature_maps_shapes
  ):
      # test whether support torchscript
      anchor = AnchorGenerator(**input_param, indexing="xy")
      images = torch.rand(image_shape)
      feature_maps = tuple(torch.rand(fs) for fs in feature_maps_shapes)
      test_script_save(anchor, images, feature_maps)
  
file_path: MONAI/tests/test_anchor_box.py
imports: from __future__ import annotations
  import unittest
  import torch
  from parameterized import parameterized
  from monai.apps.detection.utils.anchor_utils import AnchorGenerator, AnchorGeneratorWithAnchorShape
  from monai.utils import optional_import
  from tests.utils import SkipIfBeforePyTorchVersion, assert_allclose, test_script_save
label_desc: Use image node_id 2 for calling the TestAnchorGenerator obj's underlying member method code with example usage: obj.test_script_2d(input_param, image_shape, feature_maps_shapes) without return types