//  [python]
def call(self, inputs):
        # user info
        user_embed = self.user_embedding(tf.reshape(inputs['user'], [-1, ]))  # (None, embed_dim)
        # mask
        mask = tf.expand_dims(tf.to_float(tf.not_equal(inputs['click_seq'], 0)), axis=-1)  # (None, seq_len, 1)
        # seq info
        seq_embed = self.item_embedding(inputs['click_seq'])  # (None, seq_len, embed_dim)
        seq_embed *= mask
        # short-term interest
        short_interest = self.self_attention([seq_embed, seq_embed, seq_embed, mask])  # (None, dim)
        # item
        pos_embed = self.item_embedding(tf.reshape(inputs['pos_item'], [-1, ]))  # (None, embed_dim)
        neg_embed = self.item_embedding(inputs['neg_item'])  # (None, neg_num, embed_dim)
        # item2 embed
        pos_embed2 = self.item2_embedding(tf.reshape(inputs['pos_item'], [-1, ]))  # (None, embed_dim)
        neg_embed2 = self.item2_embedding(inputs['neg_item'])  # (None, neg_num, embed_dim)
        # mode
        if self.mode == 'inner':
            if self.use_l2norm:
                user_embed = tf.math.l2_normalize(user_embed, axis=-1)
                pos_embed = tf.math.l2_normalize(pos_embed, axis=-1)
                neg_embed = tf.math.l2_normalize(neg_embed, axis=-1)
                pos_embed2 = tf.math.l2_normalize(pos_embed2, axis=-1)
                neg_embed2 = tf.math.l2_normalize(neg_embed2, axis=-1)
            # long-term interest, pos and neg
            pos_long_interest = tf.multiply(user_embed, pos_embed2)  # (None, embed_dim)
            neg_long_interest = tf.multiply(tf.expand_dims(user_embed, axis=1), neg_embed2)  # (None, neg_num, embed_dim)
            pos_scores = self.w * tf.reduce_sum(pos_long_interest, axis=-1, keepdims=True) \
                         + (1 - self.w) * tf.reduce_sum(tf.multiply(short_interest, pos_embed), axis=-1, keepdims=True)
            neg_scores = self.w * tf.reduce_sum(neg_long_interest, axis=-1) \
                         + (1 - self.w) * tf.reduce_sum(tf.multiply(tf.expand_dims(short_interest, axis=1), neg_embed), axis=-1)
        else:
            # clip by norm
            user_embed = tf.clip_by_norm(user_embed, 1, -1)
            pos_embed = tf.clip_by_norm(pos_embed, 1, -1)
            neg_embed = tf.clip_by_norm(neg_embed, 1, -1)
            pos_embed2 = tf.clip_by_norm(pos_embed2, 1, -1)
            neg_embed2 = tf.clip_by_norm(neg_embed2, 1, -1)
            # distance, long-term interest, pos and neg
            pos_long_interest = tf.square(user_embed - pos_embed2)  # (None, embed_dim)
            neg_long_interest = tf.square(tf.expand_dims(user_embed, axis=1) - neg_embed2)  # (None, neg_num, embed_dim)
            # combine. Here is a difference from the original paper.
            pos_scores = self.w * tf.reduce_sum(pos_long_interest, axis=-1, keepdims=True) + \
                         (1 - self.w) * tf.reduce_sum(tf.square(short_interest - pos_embed), axis=-1, keepdims=True)
            neg_scores = self.w * tf.reduce_sum(neg_long_interest, axis=-1) + \
                         (1 - self.w) * tf.reduce_sum(tf.square(tf.expand_dims(short_interest, axis=1) - neg_embed), axis=-1)
        self.add_loss(get_loss(pos_scores, neg_scores, self.loss_name, self.gamma))
        logits = tf.concat([pos_scores, neg_scores], axis=-1)
        return logits