code: def test_generate_proposals_cuda(self, A, H, W, img_count):
      scores = np.ones((img_count, A, H, W)).astype(np.float32)
      bbox_deltas = (
          np.linspace(0, 10, num=img_count * 4 * A * H * W)
          .reshape((img_count, 4 * A, H, W))
          .astype(np.float32)
      )
      im_info = np.ones((img_count, 3)).astype(np.float32) / 10
      anchors = np.ones((A, 4)).astype(np.float32)
  
      def generate_proposals_ref():
          ref_op = core.CreateOperator(
              "GenerateProposals",
              ["scores", "bbox_deltas", "im_info", "anchors"],
              ["rois", "rois_probs"],
              spatial_scale=2.0,
          )
          workspace.FeedBlob("scores", scores)
          workspace.FeedBlob("bbox_deltas", bbox_deltas)
          workspace.FeedBlob("im_info", im_info)
          workspace.FeedBlob("anchors", anchors)
          workspace.RunOperatorOnce(ref_op)
          return workspace.FetchBlob("rois"), workspace.FetchBlob(
              "rois_probs"
          )
  
      rois, rois_probs = generate_proposals_ref()
      rois = torch.tensor(rois)
      rois_probs = torch.tensor(rois_probs)
      a, b = torch.ops._caffe2.GenerateProposals(
          torch.tensor(scores).cuda(),
          torch.tensor(bbox_deltas).cuda(),
          torch.tensor(im_info).cuda(),
          torch.tensor(anchors).cuda(),
          2.0,
          6000,
          300,
          0.7,
          16,
          True,
          -90,
          90,
          1.0,
          legacy_plus_one=True,
      )
      assert_allclose(rois, a.cpu())
      assert_allclose(rois_probs, b.cpu())
  
imports: import struct
  import unittest
  import caffe2.python.hypothesis_test_util
  import hypothesis.strategies
  import numpy
  import torch
  from caffe2.python import core, workspace
  from hypothesis import given, settings
  from scipy.stats import norm
  from ._utils import assert_allclose
label_desc: Use image node_id 6 for calling the TorchIntegration obj's underlying member method code with example usage: obj.test_generate_proposals_cuda(A, H, W, img_count) and returns: workspace,  workspace