code: def generate_path(duration, mask):
      """
      duration: [b, t_x]
      mask: [b, t_x, t_y]
      """
      device = duration.device
  
      b, t_x, t_y = mask.shape
      cum_duration = torch.cumsum(duration, 1)
      path = torch.zeros(b, t_x, t_y, dtype=mask.dtype).to(
          device=device
      )
  
      cum_duration_flat = cum_duration.view(b * t_x)
      path = sequence_mask(cum_duration_flat, t_y).to(mask.dtype)
      path = path.view(b, t_x, t_y)
      path = (
          path
          - F.pad(path, convert_pad_shape([[0, 0], [1, 0], [0, 0]]))[
              :, :-1
          ]
      )
      path = path * mask
      return path
  
file_path: TTS/TTS/tts/layers/glow_tts/monotonic_align/__init__.py
imports: import numpy
  import torch
  from torch.nn import functional
  from TTS.tts.utils.generic_utils import sequence_mask
label_desc: Use image node_id 2 for calling a global function with example usage: generate_path(duration, mask) and returns: path