Window Attention Utilities
- vformer.utils.window_utils.create_mask(window_size, shift_size, H, W)[source]
- Parameters
window_size (int) – Window Size
shift_size (int) – Shift_size
- vformer.utils.window_utils.cyclicshift(input, shift_size, dims=None)[source]
- Parameters
input (torch.Tensor) – input tensor
shift_size (int or tuple(int)) – Number of places by which input tensor is shifted
dims (int or tuple(int),optional) – Axis along which to roll
- vformer.utils.window_utils.get_relative_position_bias_index(window_size)[source]
- Parameters
window_size (int or tuple[int]) – Window size