MCPcopy Index your code
hub / github.com/modelscope/FunASR / decode

Method decode

funasr/utils/kws_utils.py:295–308  ·  view source on GitHub ↗

Get an initial state for decoding. Args: x (torch.Tensor): The encoded feature tensor Returns: decode result

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

293
294
295 def decode(self, x: torch.Tensor):
296 """Get an initial state for decoding.
297
298 Args:
299 x (torch.Tensor): The encoded feature tensor
300
301 Returns: decode result
302
303 """
304
305 raw_logp = self.ctc.softmax(x.unsqueeze(0)).detach().squeeze(0).cpu()
306 xlen = torch.tensor([raw_logp.size(1)])
307
308 return self._decode_inside(raw_logp, xlen)

Callers 15

ZMFunction · 0.45
lEFunction · 0.45
ESFunction · 0.45
QSFunction · 0.45
SRFunction · 0.45
xRFunction · 0.45
GCFunction · 0.45
OFunction · 0.45
VFunction · 0.45
decoder.jsFile · 0.45
rFunction · 0.45
jessibuca.jsFile · 0.45

Calls 2

_decode_insideMethod · 0.95
softmaxMethod · 0.45

Tested by

no test coverage detected