def update_embeddings(self, embeddings: "tf.Tensor", gradients: "tf.Tensor", mask: "tf.Tensor") -> "tf.Tensor":
        """
        Update embeddings.

        :param embeddings: Embeddings produced by the data from passing it through the first embedding layer of MalConv
        :param gradients: Gradients to update the embeddings
        :param mask: Tensor with 1s on the embeddings we modify, 0s elsewhere.
        :return embeddings: Updated embeddings wrt the adversarial objective.
        """
        import tensorflow as tf

        if self.use_sign:
            gradients = tf.sign(gradients)
        embeddings = embeddings + self.l_r * gradients * mask
        return embeddings

        Update embeddings.

        :param embeddings: Embeddings produced by the data from passing it through the first embedding layer of MalConv
        :param gradients: Gradients to update the embeddings
        :param mask: Tensor with 1s on the embeddings we modify, 0s elsewhere.
        :return embeddings: Updated embeddings wrt the adversarial objective.
        
art/attacks/evasion/pe_malware_attack.py