class_docstr: Duration calculator module.
docstr: Convert attention weight to durations.
  
  Args:
      att_ws (Tesnor): Attention weight tensor (T_feats, T_text) or
          (#layers, #heads, T_feats, T_text).
  
  Returns:
      LongTensor: Duration of each input (T_text,).
      Tensor: Focus rate value.
docstr_tok: ["Convert","attention","weight","to","durations",".","Args",":","att_ws","(","Tesnor",")",":","Attention","weight","tensor","(","T_feats",",","T_text",")","or","(","#","layers",",","#","heads",",","T_feats",",","T_text",")",".","Returns",":","LongTensor",":","Duration","of","each","input","(","T_text",",",")",".","Tensor",":","Focus","rate","value","."]
code: def forward(
      self, att_ws: torch.Tensor
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """Convert attention weight to durations.
  
      Args:
          att_ws (Tesnor): Attention weight tensor (T_feats, T_text) or
              (#layers, #heads, T_feats, T_text).
  
      Returns:
          LongTensor: Duration of each input (T_text,).
          Tensor: Focus rate value.
  
      """
      duration = self._calculate_duration(att_ws)
      focus_rate = self._calculate_focus_rete(att_ws)
  
      return duration, focus_rate
  
imports: from typing import Tuple
  import torch
label_desc: Use image node_id 1 for calling the DurationCalculator obj's underlying member method code with example usage: obj.forward(att_ws) and returns: duration,  focus_rate