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

Method extract_features

fairseq/models/fairseq_decoder.py:42–49  ·  view source on GitHub ↗

Returns: tuple: - the decoder's features of shape `(batch, tgt_len, embed_dim)` - a dictionary with any model-specific outputs

(self, prev_output_tokens, encoder_out=None, **kwargs)

Source from the content-addressed store, hash-verified

40 return x, extra
41
42 def extract_features(self, prev_output_tokens, encoder_out=None, **kwargs):
43 """
44 Returns:
45 tuple:
46 - the decoder's features of shape `(batch, tgt_len, embed_dim)`
47 - a dictionary with any model-specific outputs
48 """
49 raise NotImplementedError
50
51 def output_layer(self, features, **kwargs):
52 """

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected