code: def binarize_attention_parallel(attn, in_lens, out_lens):
      """For training purposes only. Binarizes attention with MAS.
         These will no longer receive a gradient.
  
      Args:
          attn: B x 1 x max_mel_len x max_text_len
      """
      with torch.no_grad():
          log_attn_cpu = torch.log(attn.data).cpu().numpy()
          attn_out = b_mas(
              log_attn_cpu,
              in_lens.cpu().numpy(),
              out_lens.cpu().numpy(),
              width=1,
          )
      return torch.from_numpy(attn_out).to(attn.device)
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import librosa
  import matplotlib.pylab
  import numpy
  import torch
  from einops import rearrange
  from numba import jit, prange
  from nemo.collections.tts.torch.tts_data_types import DATA_STR2DATA_CLASS, MAIN_DATA_TYPES, WithLens
  from nemo.utils import logging
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 4 for calling a global function with example usage: binarize_attention_parallel(attn, in_lens, out_lens) and returns: torch