def _calc_gradient(self, inputs, outputs, mode='auto',
                       return_format='array', options=None, force_regen=False):
        """Returns the Jacobian of derivatives between inputs and outputs.

        inputs: list of strings
            List of OpenMDAO inputs to take derivatives with respect to.

        outputs: list of strings
            Lis of OpenMDAO outputs to take derivatives of.

        mode: string in ['forward', 'adjoint', 'auto', 'fd']
            Mode for gradient calculation. Set to 'auto' to let OpenMDAO choose
            forward or adjoint based on problem dimensions. Set to 'fd' to
            finite difference the entire workflow.

        return_format: string in ['array', 'dict']
            Format for return value. Default is array, but some optimizers may
            want a dictionary instead.

        force_regen: boolean
            Set to True to force a regeneration of the system hierarchy.
        """

        # if inputs aren't specified, use parameters
        if inputs is None:
            if hasattr(self, 'list_param_group_targets'):
                inputs = self.list_param_group_targets()
            if not inputs:
                msg = "No inputs given for derivatives."
                self.raise_exception(msg, RuntimeError)

        # If outputs aren't specified, use the objectives and constraints
        if outputs is None:
            outputs = []
            if hasattr(self, 'list_objective_targets'):
                outputs.extend(self.list_objective_targets())
            if hasattr(self, 'list_constraint_targets'):
                outputs.extend(self.list_constraint_targets())
            if not outputs:
                msg = "No outputs given for derivatives."
                self.raise_exception(msg, RuntimeError)

        inputs  = [_fix_tups(x) for x in inputs]
        outputs = [_fix_tups(x) for x in outputs]

        self.workflow._calc_gradient_inputs = inputs[:]
        self.workflow._calc_gradient_outputs = outputs[:]

        try:
            if force_regen:
                top = self
                while top.parent is not None:
                    top = top.parent

                top._setup(inputs=inputs, outputs=outputs, drvname=self.name)

            if options is None:
                options = self.gradient_options

            J = self.workflow.calc_gradient(inputs, outputs, mode, return_format,
                                            options=options)

            # Finally, we need to untransform the jacobian if any parameters have
            # scalers.
            if not hasattr(self, 'get_parameters'):
                return J

            params = self.get_parameters()

            if len(params) == 0:
                return J

            i = 0
            for group in inputs:

                if isinstance(group, str):
                    pname = name = group
                else:
                    pname = tuple(group)
                    name = group[0]

                # Note: 'dict' is the only valid return_format for MPI runs.
                if return_format > 'dict':
                    if pname in params:
                        scaler = params[pname].scaler
                        if scaler != 1.0:
                            for okey in J.keys():
                                J[okey][name] = J[okey][name]*scaler

                else:
                    width = len(self._system.vec['u'][name])

                    if pname in params:
                        scaler = params[pname].scaler
                        if scaler != 1.0:
                            J[:, i:i+width] = J[:, i:i+width]*scaler

                    i += width

        finally:
            self.workflow._calc_gradient_inputs = None
            self.workflow._calc_gradient_outputs = None

        return J
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/driver.py/Driver._calc_gradient/operator `==` -> `>`