def trainable_weights(self):
        """List of all trainable weight variables of the layer.

        These are the weights that get updated by the optimizer during training.
        """
        if not self.trainable:
            return []
        return [v for v in self.weights if v.trainable]
List of all trainable weight variables of the layer.

        These are the weights that get updated by the optimizer during training.
        
keras/src/layers/layer.py