code: def score(self, encoding_hidden, hidden, method):
      # encoding = [B, T, H]
      # hidden = [B, H]
      # combined = [B,T,2H]
      if method is "concat":
          # hidden = [B,H]->[B,1,H]->[B,T,H]
          hidden = tf.expand_dims(hidden, 1)
          hidden = tf.tile(hidden, [1, encoding_hidden.shape[1], 1])
          # combined = [B,T,2H]
          combined = tf.concat([hidden, encoding_hidden], 2)
          combined = tf.cast(combined, tf.float32)
          score = tf.tensordot(
              combined, self.W, axes=[[2], [0]]
          )  # score = [B,T,H]
          score = tf.nn.tanh(score)  # score = [B,T,H]
          score = tf.tensordot(
              self.V, score, axes=[[0], [2]]
          )  # score = [1,B,T]
          score = tf.squeeze(score, axis=0)  # score = [B,T]
  
      elif method is "dot":
          # hidden = [B,H]->[B,H,1]
          hidden = tf.expand_dims(hidden, 2)
          score = tf.matmul(encoding_hidden, hidden)
          score = tf.squeeze(score, axis=2)
      elif method is "general":
          # hidden = [B,H]->[B,H,1]
          score = tf.matmul(hidden, self.W)
          score = tf.expand_dims(score, 2)
          score = tf.matmul(encoding_hidden, score)
          score = tf.squeeze(score, axis=2)
  
      score = tf.nn.softmax(score, axis=-1)  # score = [B,T]
      return score
  
imports: import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import Dense, Dropout, Input
  from tensorlayer.layers.core import Layer
  from tensorlayer.models import Model
label_desc: Use image node_id 3 for calling the Decoder_Attention obj's underlying member method code with example usage: obj.score(encoding_hidden, hidden, method) and returns: score