code: def test_strides():
      from mmdet.models.task_modules.prior_generators import (
          AnchorGenerator,
      )
  
      # Square strides
      self = AnchorGenerator([10], [1.0], [1.0], [10])
      anchors = self.grid_anchors([(2, 2)], device="cpu")
  
      expected_anchors = torch.tensor(
          [
              [-5.0, -5.0, 5.0, 5.0],
              [5.0, -5.0, 15.0, 5.0],
              [-5.0, 5.0, 5.0, 15.0],
              [5.0, 5.0, 15.0, 15.0],
          ]
      )
  
      assert torch.equal(anchors[0], expected_anchors)
  
      # Different strides in x and y direction
      self = AnchorGenerator([(10, 20)], [1.0], [1.0], [10])
      anchors = self.grid_anchors([(2, 2)], device="cpu")
  
      expected_anchors = torch.tensor(
          [
              [-5.0, -5.0, 5.0, 5.0],
              [5.0, -5.0, 15.0, 5.0],
              [-5.0, 15.0, 5.0, 25.0],
              [5.0, 15.0, 15.0, 25.0],
          ]
      )
  
      assert torch.equal(anchors[0], expected_anchors)
  
file_path: mmdetection/tests/test_models/test_task_modules/test_prior_generators/test_anchor_generator.py
imports: import pytest
  import torch
label_desc: Use image node_id 4 for calling a global function with example usage: test_strides() without return types