MCPcopy Create free account
hub / github.com/tensorflow/lingvo / ExtendStep

Method ExtendStep

lingvo/core/batch_major_attention.py:6660–6774  ·  view source on GitHub ↗

Transformer decoder layer, extend one step in autoregressive decoding. query_vec and aux_* may have different batch sizes, e.g., during a beam search. target_batch must be a multiple of source_batch and query_vec[i * batch_multiplier + j] corresponds to aux_vec[i], where batch_multi

(
      self,
      theta,
      query_vec,
      aux_vec,
      aux_paddings,
      cached_states,
      time_step,
      use_short_seq_opt=False,
      per_step_padding=None,
      *,
      compute_atten_probs=False,
      segment_mask=None,
      aux_segment_mask=None,
  )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Calls 4

_GetSourceBatchSizeMethod · 0.95
_GetSourceLengthMethod · 0.95
ExtendStepMethod · 0.45
FPropMethod · 0.45