class_docstr: Layer that computes attention strengths by masking out the "future".
  
  Causal attention uses masking to prevent a given sequence position from
  attending to positions greater than / following it. This is used, for
  example, when training autoregressive sequence models, or when decoding a
  sequence symbol by symbol.
  
  This layer performs the core per-head attention calculation. The layer
  assumes that any splitting into attention heads precedes it, and that any
  merging of attention heads will follow it.
class_docstr_tok: ["Layer","that","computes","attention","strengths","by","masking","out","the","``","future","''",".","Causal","attention","uses","masking","to","prevent","a","given","sequence","position","from","attending","to","positions","greater","than","\/","following","it",".","This","is","used",",","for","example",",","when","training","autoregressive","sequence","models",",","or","when","decoding","a","sequence","symbol","by","symbol",".","This","layer","performs","the","core","per-head","attention","calculation",".","The","layer","assumes","that","any","splitting","into","attention","heads","precedes","it",",","and","that","any","merging","of","attention","heads","will","follow","it","."]
code: def monkey_patched_mask(self):
      # This is necessary for Terraformer model. See comments there.
      # The mask will only be used in Terraformer in predict mode.
      return None
  
imports: import numpy
  from trax import fastmath
  from trax.fastmath import numpy
  from trax.layers import base
  from trax.layers import combinators
  from trax.layers import convolution
  from trax.layers import core
  from trax.layers import initializers
  from trax.layers.assert_shape import assert_shape
  from trax.layers.base import Fn
  from trax.layers.research import sparsity
label_desc: Use image node_id 2 for calling the DotProductCausalAttention obj's underlying member method code with example usage: obj.monkey_patched_mask() and returns: None