def configure_gradient_clipping(
        self,
        optimizer: Optimizer,
        gradient_clip_val: Optional[Union[int, float]] = None,
        gradient_clip_algorithm: Optional[str] = None,
    ) -> None:
        """Perform gradient clipping for the optimizer parameters. Called before :meth:`optimizer_step`.

        Args:
            optimizer: Current optimizer being used.
            gradient_clip_val: The value at which to clip gradients. By default, value passed in Trainer
                will be available here.
            gradient_clip_algorithm: The gradient clipping algorithm to use. By default, value
                passed in Trainer will be available here.

        Example::

            def configure_gradient_clipping(self, optimizer, gradient_clip_val, gradient_clip_algorithm):
                # Implement your own custom logic to clip gradients
                # You can call `self.clip_gradients` with your settings:
                self.clip_gradients(
                    optimizer,
                    gradient_clip_val=gradient_clip_val,
                    gradient_clip_algorithm=gradient_clip_algorithm
                )

        """
        self.clip_gradients(
            optimizer, gradient_clip_val=gradient_clip_val, gradient_clip_algorithm=gradient_clip_algorithm
        )
Perform gradient clipping for the optimizer parameters. Called before :meth:`optimizer_step`.

        Args:
            optimizer: Current optimizer being used.
            gradient_clip_val: The value at which to clip gradients. By default, value passed in Trainer
                will be available here.
            gradient_clip_algorithm: The gradient clipping algorithm to use. By default, value
                passed in Trainer will be available here.

        Example::

            def configure_gradient_clipping(self, optimizer, gradient_clip_val, gradient_clip_algorithm):
                # Implement your own custom logic to clip gradients
                # You can call `self.clip_gradients` with your settings:
                self.clip_gradients(
                    optimizer,
                    gradient_clip_val=gradient_clip_val,
                    gradient_clip_algorithm=gradient_clip_algorithm
                )

        
src/lightning/pytorch/core/module.py