(self, dropout=0.0, mode='train')
Creates a :py:class:`DotProductAttention` instance in a specific mode.

    Args:
      dropout: Probababilistic rate for attention dropout, which overrides
          (sets to zero) some attention strengths derived from query-key
          matching. As a result, on a given forward pass, some value vectors
          don't contribute to the output, analogous to how regular dropout can
          cause some node activations to be ignored. Applies only if layer is
          created in ``'train'`` mode.
      mode: One of ``'train'``, ``'eval'``, ``'predict'`` or ``'viz'``.
Creates a :py:class:`DotProductAttention` instance in a specific mode.
Creates a : py : class : DotProductAttention instance in a specific mode .
def __init__(self, dropout=0.0, mode='train'):
    """Creates a :py:class:`DotProductAttention` instance in a specific mode.

    Args:
      dropout: Probababilistic rate for attention dropout, which overrides
          (sets to zero) some attention strengths derived from query-key
          matching. As a result, on a given forward pass, some value vectors
          don't contribute to the output, analogous to how regular dropout can
          cause some node activations to be ignored. Applies only if layer is
          created in ``'train'`` mode.
      mode: One of ``'train'``, ``'eval'``, ``'predict'`` or ``'viz'``.
    """
    super().__init__(n_in=4, n_out=1)
    self._dropout = dropout
    self._mode = mode
def __init__ ( self , dropout = 0.0 , mode = 'train' ) : super ( ) . __init__ ( n_in = 4 , n_out = 1 ) self . _dropout = dropout self . _mode = mode