code: def maximum_path(
      neg_x_ent: torch.Tensor, attn_mask: torch.Tensor
  ) -> torch.Tensor:
      """Calculate maximum path.
  
      Args:
          neg_x_ent (Tensor): Negative X entropy tensor (B, T_feats, T_text).
          attn_mask (Tensor): Attention mask (B, T_feats, T_text).
  
      Returns:
          Tensor: Maximum path tensor (B, T_feats, T_text).
  
      """
      device, dtype = neg_x_ent.device, neg_x_ent.dtype
      neg_x_ent = neg_x_ent.cpu().numpy().astype(np.float32)
      path = np.zeros(neg_x_ent.shape, dtype=np.int32)
      t_t_max = attn_mask.sum(1)[:, 0].cpu().numpy().astype(np.int32)
      t_s_max = attn_mask.sum(2)[:, 0].cpu().numpy().astype(np.int32)
      if is_cython_avalable:
          maximum_path_c(path, neg_x_ent, t_t_max, t_s_max)
      else:
          maximum_path_numba(path, neg_x_ent, t_t_max, t_s_max)
  
      return torch.from_numpy(path).to(device=device, dtype=dtype)
  
imports: import warnings
  import numpy
  import torch
  from numba import njit, prange
label_desc: Use image node_id 1 for calling a global function with example usage: maximum_path(neg_x_ent, attn_mask) and returns: torch