MCPcopy Create free account
hub / github.com/modelscope/FunASR / collect_feats

Method collect_feats

funasr/models/data2vec/data2vec.py:105–115  ·  view source on GitHub ↗

Collect feats. Args: speech: Speech audio tensor, shape (batch, time). speech_lengths: Length of each speech sample.

(
        self, speech: torch.Tensor, speech_lengths: torch.Tensor
    )

Source from the content-addressed store, hash-verified

103 return loss, stats, weight
104
105 def collect_feats(
106 self, speech: torch.Tensor, speech_lengths: torch.Tensor
107 ) -> Dict[str, torch.Tensor]:
108 """Collect feats.
109
110 Args:
111 speech: Speech audio tensor, shape (batch, time).
112 speech_lengths: Length of each speech sample.
113 """
114 feats, feats_lengths = self._extract_feats(speech, speech_lengths)
115 return {"feats": feats, "feats_lengths": feats_lengths}
116
117 def encode(
118 self,

Callers

nothing calls this directly

Calls 1

_extract_featsMethod · 0.95

Tested by

no test coverage detected