MCPcopy
hub / github.com/modelscope/FunASR / argmax

Method argmax

funasr/models/ctc/ctc.py:205–216  ·  view source on GitHub ↗

argmax of frame activations Args: torch.Tensor hs_pad: 3d tensor (B, Tmax, eprojs) Returns: torch.Tensor: argmax applied 2d tensor (B, Tmax)

(self, hs_pad)

Source from the content-addressed store, hash-verified

203 return F.log_softmax(hs_pad, dim=2)
204
205 def argmax(self, hs_pad):
206 """argmax of frame activations
207
208 Args:
209 torch.Tensor hs_pad: 3d tensor (B, Tmax, eprojs)
210 Returns:
211 torch.Tensor: argmax applied 2d tensor (B, Tmax)
212 """
213 if self.ctc_lo is not None:
214 return torch.argmax(self.ctc_lo(hs_pad), dim=2)
215 else:
216 return torch.argmax(hs_pad, dim=2)

Callers 15

th_accuracyFunction · 0.45
forwardMethod · 0.45
_calc_att_lossMethod · 0.45
_calc_ctc_lossMethod · 0.45
_calc_att_lossMethod · 0.45
_calc_ctc_lossMethod · 0.45
_calc_att_lossMethod · 0.45
inferenceMethod · 0.45
report_coreMethod · 0.45
_calc_att_lossMethod · 0.45
samplerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected