code: def find_minimum_hlens(self, ys_pad, ylens):
      device = ys_pad.device
      ys_pad, ylens = ys_pad.cpu().tolist(), ylens.cpu().tolist()
      ys, min_hlens = [], []
  
      for y_pad, ylen in zip(ys_pad, ylens):
          y, min_hlen = [], 0
          prev = None
  
          for i in range(ylen):
              y.append(y_pad[i])
              min_hlen += 1
  
              if y_pad[i] == prev:
                  min_hlen += 1
  
              prev = y_pad[i]
  
          ys.append(y)
          min_hlens.append(min_hlen)
  
      min_hlens = torch.Tensor(min_hlens).long().to(device)
  
      return ys, min_hlens
  
file_path: espnet/espnet2/asr/bayes_risk_ctc.py
imports: import logging
  import _k2
  import k2
  import torch
label_desc: Use image node_id 6 for calling the BayesRiskCTC obj's underlying member method code with example usage: obj.find_minimum_hlens(ys_pad, ylens) and returns: ys,  min_hlens