def METHOD_NAME(self):
    embeds = SharedEmbedding.from_array(self.x, self.weight_path)
    u = paddle.to_tensor([[1.], [-1]])
    indexs = paddle.to_tensor([0, 2])
    grad = paddle.to_tensor([[1., 1.], [-1, -1]])
    tensors = embeds(indexs)
    loss = (tensors * u).sum()
    loss.backward()
    trace = embeds.create_trace(paddle.to_tensor(indexs), tensors)
    self.assertTrue((trace[1][0] == grad).all())