class_docstr: TransformerConv
docstr: reduce attention
docstr_tok: ["reduce","attention"]
code: def reduce_attention(self, msg):
      """reduce attention"""
      if self.use_degree_norm:
          gate = F.sigmoid(self.gate)
          alpha = (
              gate * msg.reduce_softmax(msg["alpha"])
              + (1 - gate) * msg["deg"]
          )
      else:
          alpha = msg.reduce_softmax(msg["alpha"])
      alpha = paddle.reshape(alpha, [-1, self.nheads, 1])
      feature = msg["v"]
      feature = feature * alpha
      feature = paddle.reshape(
          feature, [-1, self.nheads * self.head_dim]
      )
      feature = msg.reduce(feature, pool_type="sum")
      return feature
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  import pgl
  import math
  from .None import model_util
label_desc: Use image node_id 3 for calling the TransformerConv obj's underlying member method code with example usage: obj.reduce_attention(msg) and returns: feature