Shortcuts

mmcls.models.utils.resize_relative_position_bias_table

mmcls.models.utils.resize_relative_position_bias_table(src_shape, dst_shape, table, num_head)[源代码]

Resize relative position bias table.

参数
  • src_shape (int) – The resolution of downsampled origin training image, in format (H, W).

  • dst_shape (int) – The resolution of downsampled new training image, in format (H, W).

  • table (tensor) – The relative position bias of the pretrained model.

  • num_head (int) – Number of attention heads.

返回

The resized relative position bias table.

返回类型

torch.Tensor