class_docstr: Self-attention layer (specification key: `self_attention`).
  
  Args:
      size (int >= 0): Layer output size, 0 implies additionally removing the axis
          (<span style="color:#C00000"><b>required</b></span>).
      attention_size (int > 0): Query/key size
          (<span style="color:#00C000"><b>default</b></span>: same as output size).
      bias (bool): Whether to add a trainable bias variable
          (<span style="color:#00C000"><b>default</b></span>: false).
      activation ('crelu' | 'elu' | 'leaky-relu' | 'none' | 'relu' | 'selu' | 'sigmoid' |
          'softmax' | 'softplus' | 'softsign' | 'swish' | 'tanh'): Activation nonlinearity
          (<span style="color:#00C000"><b>default</b></span>: none).
      dropout (parameter, 0.0 <= float < 1.0): Dropout rate
          (<span style="color:#00C000"><b>default</b></span>: 0.0).
      initialization_scale (float > 0.0): Initialization scale
          (<span style="color:#00C000"><b>default</b></span>: 1.0).
      vars_trainable (bool): Whether layer variables are trainable
          (<span style="color:#00C000"><b>default</b></span>: true).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Self-attention","layer","(","specification","key",":","`","self_attention","`",")",".","Args",":","size","(","int",">","=","0",")",":","Layer","output","size",",","0","implies","additionally","removing","the","axis","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","attention_size","(","int",">","0",")",":","Query\/key","size","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","same","as","output","size",")",".","bias","(","bool",")",":","Whether","to","add","a","trainable","bias","variable","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","false",")",".","activation","(","'crelu","'","|","'elu","'","|","'leaky-relu","'","|","'none","'","|","'relu","'","|","'selu","'","|","'sigmoid","'","|","'softmax","'","|","'softplus","'","|","'softsign","'","|","'swish","'","|","'tanh","'",")",":","Activation","nonlinearity","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","none",")",".","dropout","(","parameter",",","0.0","<","=","float","<","1.0",")",":","Dropout","rate","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","0.0",")",".","initialization_scale","(","float",">","0.0",")",":","Initialization","scale","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","1.0",")",".","vars_trainable","(","bool",")",":","Whether","layer","variables","are","trainable","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","true",")",".","l2_regularization","(","float",">","=","0.0",")",":","Scalar","controlling","L2","regularization","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","inherit","value","of","parent","module",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def output_spec(self):
      return self.value.output_spec()
  
file_path: tensorforce/tensorforce/core/layers/attention.py
imports: import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Linear, TransformationBase
label_desc: Use image node_id 3 for calling the SelfAttention obj's underlying member method code with example usage: obj.output_spec() and returns: self