def METHOD_NAME(self):
    src, dsts = L.read_file(self.pyreader)
    if self.is_sparse:
        # sparse mode use 2 dims input.
        src = L.reshape(src, [-1, 1])
        dsts = L.reshape(dsts, [-1, 1])
    if self.num_part is not None and self.num_part != 1 and not self.is_distributed:
        src_embed = split_embedding(
            src,
            self.num_nodes,
            self.hidden_size,
            self.embed_init,
            "weight",
            self.num_part,
            self.is_sparse,
            learning_rate=self.embedding_lr)
        dsts_embed = split_embedding(
            dsts,
            self.num_nodes,
            self.hidden_size,
            self.embed_init,
            "weight",
            self.num_part,
            self.is_sparse,
            learning_rate=self.embedding_lr)
    else:
        src_embed = L.embedding(
            src, (self.num_nodes, self.hidden_size),
            self.is_sparse,
            self.is_distributed,
            param_attr=F.ParamAttr(
                name="weight",
                learning_rate=self.embedding_lr,
                initializer=self.embed_init))
        dsts_embed = L.embedding(
            dsts, (self.num_nodes, self.hidden_size),
            self.is_sparse,
            self.is_distributed,
            param_attr=F.ParamAttr(
                name="weight",
                learning_rate=self.embedding_lr,
                initializer=self.embed_init))
    if self.is_sparse:
        # reshape back
        src_embed = L.reshape(src_embed, [-1, 1, self.hidden_size])
        dsts_embed = L.reshape(dsts_embed,
                               [-1, self.neg_num + 1, self.hidden_size])
    logits = L.matmul(
        src_embed, dsts_embed,
        transpose_y=True)  # [batch_size, 1, neg_num+1]
    pos_label = L.fill_constant_batch_size_like(logits, [-1, 1, 1],
                                                "float32", 1)
    neg_label = L.fill_constant_batch_size_like(
        logits, [-1, 1, self.neg_num], "float32", 0)
    label = L.concat([pos_label, neg_label], -1)
    pos_weight = L.fill_constant_batch_size_like(logits, [-1, 1, 1],
                                                 "float32", self.neg_num)
    neg_weight = L.fill_constant_batch_size_like(
        logits, [-1, 1, self.neg_num], "float32", 1)
    weight = L.concat([pos_weight, neg_weight], -1)
    weight.stop_gradient = True
    label.stop_gradient = True
    loss = L.sigmoid_cross_entropy_with_logits(logits, label)
    loss = loss * weight
    loss = L.reduce_mean(loss)
    loss = loss * ((self.neg_num + 1) / 2 / self.neg_num)
    loss.persistable = True
    self.loss = loss
    return loss