code: def test_roi_align_aligned(self):
      supported_onnx_version = _register_onnx_ops._ONNX_OPSET_VERSION_16
      x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
      single_roi = torch.tensor(
          [[0, 1.5, 1.5, 3, 3]], dtype=torch.float32
      )
      model = ops.RoIAlign((5, 5), 1, 2, aligned=True)
      self.run_model(
          model, [(x, single_roi)], opset_version=supported_onnx_version
      )
  
      x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
      single_roi = torch.tensor(
          [[0, 0.2, 0.3, 4.5, 3.5]], dtype=torch.float32
      )
      model = ops.RoIAlign((5, 5), 0.5, 3, aligned=True)
      self.run_model(
          model, [(x, single_roi)], opset_version=supported_onnx_version
      )
  
      x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
      single_roi = torch.tensor(
          [[0, 0.2, 0.3, 4.5, 3.5]], dtype=torch.float32
      )
      model = ops.RoIAlign((5, 5), 1.8, 2, aligned=True)
      self.run_model(
          model, [(x, single_roi)], opset_version=supported_onnx_version
      )
  
      x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
      single_roi = torch.tensor(
          [[0, 0.2, 0.3, 4.5, 3.5]], dtype=torch.float32
      )
      model = ops.RoIAlign((2, 2), 2.5, 0, aligned=True)
      self.run_model(
          model, [(x, single_roi)], opset_version=supported_onnx_version
      )
  
      x = torch.rand(1, 1, 10, 10, dtype=torch.float32)
      single_roi = torch.tensor(
          [[0, 0.2, 0.3, 4.5, 3.5]], dtype=torch.float32
      )
      model = ops.RoIAlign((2, 2), 2.5, -1, aligned=True)
      self.run_model(
          model, [(x, single_roi)], opset_version=supported_onnx_version
      )
  
imports: import io
  from collections import OrderedDict
  from typing import List, Optional, Tuple
  import pytest
  import torch
  from common_utils import assert_equal, set_rng_seed
  from torchvision import models, ops
  from torchvision.models.detection.faster_rcnn import FastRCNNPredictor, TwoMLPHead
  from torchvision.models.detection.image_list import ImageList
  from torchvision.models.detection.roi_heads import RoIHeads
  from torchvision.models.detection.rpn import AnchorGenerator, RegionProposalNetwork, RPNHead
  from torchvision.models.detection.transform import GeneralizedRCNNTransform
  from torchvision.ops import _register_onnx_ops
label_desc: Use image node_id 8 for calling the TestONNXExporter obj's underlying member method code with example usage: obj.test_roi_align_aligned() without return types