def supports_flat_params(self):
        """
        Whether the optimizer supports collapsing of the model
        parameters/gradients into a single contiguous Tensor.
        """
        if hasattr(self.optimizer, "supports_flat_params"):
            return self.optimizer.supports_flat_params
        return False

        Whether the optimizer supports collapsing of the model
        parameters/gradients into a single contiguous Tensor.
        
understand_icl/fairseq/fairseq/optim/fairseq_optimizer.py