class_docstr: Correlation
code: def build_crossscale_correlation(
      cls, query_feats, key_feats, scales, conv2ds
  ):
      bsz, _, hq, wq = query_feats.size()
      bsz, _, hk, wk = key_feats.size()
  
      # Construct feature pairs with multiple scales
      query_feats_scalewise = []
      key_feats_scalewise = []
      for scale, conv in zip(scales, conv2ds):
          shq = round(hq * math.sqrt(scale))
          swq = round(wq * math.sqrt(scale))
          shk = round(hk * math.sqrt(scale))
          swk = round(wk * math.sqrt(scale))
  
          query_feats_out = conv(
              resize(
                  query_feats,
                  (shq, swq),
                  mode="bilinear",
                  align_corners=True,
              )
          )
          key_feats_out = conv(
              resize(
                  key_feats,
                  (shk, swk),
                  mode="bilinear",
                  align_corners=True,
              )
          )
  
          query_feats_scalewise.append(query_feats_out)
          key_feats_scalewise.append(key_feats_out)
  
      corrs = cls.compute_crossscale_correlation(
          query_feats_scalewise,
          key_feats_scalewise,
          (bsz, hq, wq, hk, wk),
      )
  
      return corrs.contiguous()
  
file_path: towhee/towhee/models/cvnet/cvnet_block.py
imports: import torch
  from torch import nn
  import torch.nn.functional
  from torch.nn.functional import interpolate
  from towhee.models.layers.conv4d import CenterPivotConv4d
  from towhee.models.cvnet.cvnet_utils import Geometry
  import math
label_desc: Use image node_id 2 for calling the Correlation obj's underlying member method code with example usage: obj.build_crossscale_correlation(cls, query_feats, key_feats, scales, conv2ds) and returns: corrs