code: def compute_recurrent_attention_logits(
      hidden_t,
      weighted_decoder_hidden_state_t_w,
      weighted_decoder_hidden_state_t_b,
      attention_weighted_encoder_context_t_prev,
      weighted_prev_attention_context_w,
      weighted_prev_attention_context_b,
      attention_v,
      weighted_encoder_outputs,
      encoder_outputs_for_dot_product,
      coverage_prev,
      coverage_weights,
  ):
      weighted_hidden_t = (
          np.dot(
              hidden_t,
              weighted_decoder_hidden_state_t_w.T,
          )
          + weighted_decoder_hidden_state_t_b
      )
      weighted_prev_attention_context = (
          np.dot(
              attention_weighted_encoder_context_t_prev,
              weighted_prev_attention_context_w.T,
          )
          + weighted_prev_attention_context_b
      )
      attention_v = attention_v.reshape([-1])
      return np.sum(
          attention_v
          * np.tanh(
              weighted_encoder_outputs
              + weighted_hidden_t
              + weighted_prev_attention_context
          ),
          axis=2,
      )
  
imports: from caffe2.python import core, gradient_checker, rnn_cell, workspace, scope, utils
  from caffe2.python.attention import AttentionType
  from caffe2.python.model_helper import ModelHelper, ExtractPredictorNet
  from caffe2.python.rnn.rnn_cell_test_util import sigmoid, tanh, _prepare_rnn
  from caffe2.proto import caffe2_pb2
  import caffe2.python.hypothesis_test_util
  from functools import partial
  from hypothesis import assume, given
  from hypothesis import settings
  import hypothesis.strategies
  import numpy
  import unittest
label_desc: Use image node_id 7 for calling a global function with example usage: compute_recurrent_attention_logits(hidden_t, weighted_decoder_hidden_state_t_w, weighted_decoder_hidden_state_t_b, attention_weighted_encoder_context_t_prev, weighted_prev_attention_context_w, weighted_prev_attention_context_b, attention_v, weighted_encoder_outputs, encoder_outputs_for_dot_product, coverage_prev, coverage_weights) and returns: np