//  [python]
def __call__(self, features, is_training):
        seqs_ids = features['seqs_i']
        seqs_ts = features['seqs_t'] / self.time_scale

        seqs_spans = clip_by_value(seqs_ts[:, 1:] - seqs_ts[:, :-1])
        seqs_spans = tf.concat([seqs_spans[:, :1], seqs_spans], axis=-1)

        seqs_marks = tf.where(tf.equal(seqs_ids, self.mask), tf.zeros_like(seqs_ids), seqs_ids)
        seqs_marks = tf.nn.embedding_lookup(self.mark_lookup_table, seqs_marks)

        # temporal encoding
        seqs_tcodes = self.tcoding.code(seqs_ts)

        # positional encoding
        seqs_units = self.item_embs(seqs_ids) + seqs_tcodes
        posn_codes = self.pcoding.code(seqs_units)

        # event mark encoding
        marks_codes = tf.nn.embedding_lookup(self.mark_embs.lookup_table, seqs_marks)
        marks_codes = tf.reduce_sum(marks_codes, axis=2)
        seqs_units = tf.concat([seqs_units, posn_codes, marks_codes], axis=-1)

        # Dropout
        seqs_units = tf.layers.dropout(seqs_units, rate=self.hidden_dropout_rate,
                                       training=tf.convert_to_tensor(is_training))
        seqs_masks = tf.expand_dims(tf.to_float(tf.not_equal(seqs_ids, 0)), 1)
        seqs_masks = tf.tile(seqs_masks, [self.num_heads, tf.shape(seqs_ids)[1], 1])

        # Run the stacked transformer.
        # `sequence_output` shape = [batch_size, seq_length, hidden_size].
        prev_outputs = seqs_units
        for i, attention in enumerate(self.list_attention):
            with tf.variable_scope("layer_%d" % i):
                layer_inputs = prev_outputs

                with tf.variable_scope("attention"):
                    with tf.variable_scope("self"):
                        # sequential-temporal representations
                        attention_outs, seqs_intny = attention(layer_inputs, layer_inputs, seqs_masks,
                                                               seqs_spans, seqs_marks, is_training)

                    # Run a linear projection of `hidden_size` then add a residual
                    # with `layer_input`.
                    with tf.variable_scope("output"):
                        attention_outs = tf.layers.dense(attention_outs, self.num_units)
                        attention_outs = tf.layers.dropout(attention_outs, rate=self.hidden_dropout_rate,
                                                           training=is_training)
                        attention_outs = layernorm(attention_outs + layer_inputs[:, :, :self.num_units])

                # The activation is only applied to the "intermediate" hidden layer.
                with tf.variable_scope("intermediate"):
                    intermediate_outputs = tf.layers.dense(attention_outs, 2 * self.num_units,
                                                           activation=gelu)

                # Down-project back to `hidden_size` then add the residual.
                with tf.variable_scope("output"):
                    layer_outputs = tf.layers.dense(intermediate_outputs, self.num_units)
                    layer_outputs = tf.layers.dropout(layer_outputs, rate=self.hidden_dropout_rate,
                                                      training=is_training)
                    layer_outputs = layernorm(layer_outputs + attention_outs)
                    prev_outputs = layer_outputs

                # likelihood for point process
                if is_training:
                    tf.add_to_collection("LLE_PP", seqs_intny)

        seqs_outs = prev_outputs
        with tf.variable_scope("cls/predictions"):
            with tf.variable_scope("transform"):
                seqs_outs = tf.layers.dense(seqs_outs, self.num_units, activation=gelu)
                seqs_outs = layernorm(seqs_outs)

        if is_training:
            seqs_outs = tf.batch_gather(seqs_outs, features['masked_positions'])
            seqs_outs = tf.reshape(seqs_outs, [tf.shape(seqs_ids)[0] * self.masklen, self.num_units])
        else:
            # only using the latest representations for making predictions
            seqs_outs = tf.reshape(seqs_outs[:, -1], [tf.shape(seqs_ids)[0], self.num_units])

        # compute logits
        logits = tf.matmul(seqs_outs, self.item_embs.lookup_table, transpose_b=True)
        logits = tf.nn.bias_add(logits, self.output_bias)
        return logits