(memory, keys, strength)
return content_weighting
:param memory: array of shape [batch_size, memory_size, word_size], i.e. [b, n, w]
        :param keys: array of shape [batch_size, n_keys, word_size], i.e. [b, r, w]
        :param strength: array of shape [batch_size, n_keys], i.e. [b, r]
        :return: tensor of shape [batch_size, memory_size, n_keys]
:param memory: array of shape [batch_size, memory_size, word_size], i.e. [b, n, w]
        :param keys: array of shape [batch_size, n_keys, word_size], i.e. [b, r, w]
        :param strength: array of shape [batch_size, n_keys], i.e. [b, r]
        :return: tensor of shape [batch_size, memory_size, n_keys]
: param memory : array of shape [ batch_size memory_size word_size ] i . e . [ b n w ] : param keys : array of shape [ batch_size n_keys word_size ] i . e . [ b r w ] : param strength : array of shape [ batch_size n_keys ] i . e . [ b r ] : return : tensor of shape [ batch_size memory_size n_keys ]
def content_based_addressing(memory, keys, strength):
        """
        
        :param memory: array of shape [batch_size, memory_size, word_size], i.e. [b, n, w]
        :param keys: array of shape [batch_size, n_keys, word_size], i.e. [b, r, w]
        :param strength: array of shape [batch_size, n_keys], i.e. [b, r]
        :return: tensor of shape [batch_size, memory_size, n_keys]
        """
        keys = tf.nn.l2_normalize(keys, dim=2)
        memory = tf.nn.l2_normalize(memory, dim=2)
        similarity = tf.einsum("bnw,brw,br->bnr", memory, keys, strength)
        content_weighting = tf.nn.softmax(similarity, dim=1, name="Content_weighting")

        return content_weighting
def content_based_addressing ( memory , keys , strength ) : keys = tf . nn . l2_normalize ( keys , dim = 2 ) memory = tf . nn . l2_normalize ( memory , dim = 2 ) similarity = tf . einsum ( "bnw,brw,br->bnr" , memory , keys , strength ) content_weighting = tf . nn . softmax ( similarity , dim = 1 , name = "Content_weighting" ) return content_weighting