class_docstr: Base class for recurrent memory.
  
  This class defines the memory interface, but behaves like a no-op.
class_docstr_tok: ["Base","class","for","recurrent","memory",".","This","class","defines","the","memory","interface",",","but","behaves","like","a","no-op","."]
docstr: Called prior to self-attention, to incorporate memory items.
  
  Args:
    segment: an integer Tensor with shape [batch]
    query_antecedent: a Tensor with shape [batch, length_q, channels]
    memory_antecedent: must be None. Attention normally allows this to be a
      Tensor with shape [batch, length_m, channels], but we currently only
      support memory for decoder-side self-attention.
    bias: bias Tensor (see attention_bias())
  Returns:
    (data, new_query_antecedent, new_memory_antecedent, new_bias)
docstr_tok: ["Called","prior","to","self-attention",",","to","incorporate","memory","items",".","Args",":","segment",":","an","integer","Tensor","with","shape","[","batch","]","query_antecedent",":","a","Tensor","with","shape","[","batch",",","length_q",",","channels","]","memory_antecedent",":","must","be","None",".","Attention","normally","allows","this","to","be","a","Tensor","with","shape","[","batch",",","length_m",",","channels","]",",","but","we","currently","only","support","memory","for","decoder-side","self-attention",".","bias",":","bias","Tensor","(","see","attention_bias","(",")",")","Returns",":","(","data",",","new_query_antecedent",",","new_memory_antecedent",",","new_bias",")"]
code: def pre_attention(
      self, segment, query_antecedent, memory_antecedent, bias
  ):
      """Called prior to self-attention, to incorporate memory items.
  
      Args:
        segment: an integer Tensor with shape [batch]
        query_antecedent: a Tensor with shape [batch, length_q, channels]
        memory_antecedent: must be None. Attention normally allows this to be a
          Tensor with shape [batch, length_m, channels], but we currently only
          support memory for decoder-side self-attention.
        bias: bias Tensor (see attention_bias())
      Returns:
        (data, new_query_antecedent, new_memory_antecedent, new_bias)
      """
      del segment
      return None, query_antecedent, memory_antecedent, bias
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the RecurrentMemory obj's underlying member method code with example usage: obj.pre_attention(segment, query_antecedent, memory_antecedent, bias) and returns: None,  query_antecedent,  memory_antecedent,  bias