MCPcopy Create free account
hub / github.com/FLC777/GLAT / forward

Method forward

fairseq/models/fairseq_encoder.py:33–41  ·  view source on GitHub ↗

Args: src_tokens (LongTensor): tokens in the source language of shape `(batch, src_len)` src_lengths (LongTensor): lengths of each source sentence of shape `(batch)`

(self, src_tokens, src_lengths=None, **kwargs)

Source from the content-addressed store, hash-verified

31 self.dictionary = dictionary
32
33 def forward(self, src_tokens, src_lengths=None, **kwargs):
34 """
35 Args:
36 src_tokens (LongTensor): tokens in the source language of shape
37 `(batch, src_len)`
38 src_lengths (LongTensor): lengths of each source sentence of shape
39 `(batch)`
40 """
41 raise NotImplementedError
42
43 def forward_torchscript(self, net_input: Dict[str, Tensor]):
44 """A TorchScript-compatible version of forward.

Callers 2

forward_torchscriptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected