code: def mask_border_with_padding(
      m: Tensor,
      bd: int,
      v: Union[Tensor, float, bool],
      p_m0: Tensor,
      p_m1: Tensor,
  ) -> None:
      if bd <= 0:
          return
  
      m[:, :bd] = v
      m[:, :, :bd] = v
      m[:, :, :, :bd] = v
      m[:, :, :, :, :bd] = v
  
      h0s, w0s = (
          p_m0.sum(1).max(-1)[0].int(),
          p_m0.sum(-1).max(-1)[0].int(),
      )
      h1s, w1s = (
          p_m1.sum(1).max(-1)[0].int(),
          p_m1.sum(-1).max(-1)[0].int(),
      )
      for b_idx, (h0, w0, h1, w1) in enumerate(zip(h0s, w0s, h1s, w1s)):
          m[b_idx, h0 - bd :] = v
          m[b_idx, :, w0 - bd :] = v
          m[b_idx, :, :, h1 - bd :] = v
          m[b_idx, :, :, :, w1 - bd :] = v
  
file_path: kornia/kornia/feature/loftr/utils/coarse_matching.py
imports: from typing import Any, Dict, Optional, Union
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: mask_border_with_padding(m, bd, v, p_m0, p_m1) without return types