code: def get_reference_points(spatial_shapes, device):
      reference_points_list = []
      for lvl, (H_, W_) in enumerate(spatial_shapes):
          ref_y, ref_x = torch.meshgrid(
              torch.linspace(
                  0.5, H_ - 0.5, H_, dtype=torch.float32, device=device
              ),
              torch.linspace(
                  0.5, W_ - 0.5, W_, dtype=torch.float32, device=device
              ),
          )
          ref_y = ref_y.reshape(-1)[None] / H_
          ref_x = ref_x.reshape(-1)[None] / W_
          ref = torch.stack((ref_x, ref_y), -1)
          reference_points_list.append(ref)
      reference_points = torch.cat(reference_points_list, 1)
      reference_points = reference_points[:, :, None]
      return reference_points
  
imports: from functools import partial
  import torch
  import torch.nn
  import torch.utils.checkpoint
  from ...ops.modules import MSDeformAttn
  from .drop_path import DropPath
label_desc: Use image node_id 1 for calling a global function with example usage: get_reference_points(spatial_shapes, device) and returns: reference_points