code: def forward(self, hard_attention, soft_attention):
      log_sum = torch.log(
          torch.clamp(soft_attention[hard_attention == 1], min=1e-12)
      ).sum()
      loss = -log_sum / hard_attention.sum()
      loss *= self.loss_scale
      return loss
  
file_path: NeMo/nemo/collections/tts/losses/aligner_loss.py
imports: import torch
  import torch.nn.functional
  from nemo.core.classes import Loss, typecheck
  from nemo.core.neural_types.elements import LengthsType, LogprobsType, LossType, ProbsType
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 4 for calling the BinLoss obj's underlying member method code with example usage: obj.forward(hard_attention, soft_attention) and returns: loss