def compute_partials(self, inputs, partials):
    if ((self.metadata['jacobian_type'] != 'matvec') and (not self.metadata['finite_difference'])):
        pd_type = self.metadata['partial_type']
        for i in range(self.metadata['num_var']):
            in_var = self._cycle_names['x'].format(i)
            partials[('x_norm2', in_var)] = self.make_jacobian_entry(inputs[in_var].flat[:], pd_type)
        k = self.metadata['num_comp']
        theta_out = self._cycle_names['theta_out']
        theta = self._cycle_names['theta']
        partials[(theta_out, theta)] = self.make_jacobian_entry(np.array([0.5]), pd_type)
        partials[(theta_out, self._cycle_names['psi'])] = self.make_jacobian_entry(np.array([((- 1) / ((2 * k) - 2))]), pd_type)
def compute_partials(self, inputs, partials):
    if ((self.metadata['jacobian_type'] != 'matvec') and (not self.metadata['finite_difference'])):
        pd_type = self.metadata['partial_type']
        for i in range(self.metadata['num_var']):
            in_var = self._cycle_names['x'].format(i)
            partials[('x_norm2', in_var)] = self.make_jacobian_entry(inputs[in_var].flat[:], pd_type)
        k = self.metadata['num_comp']
        theta_out = self._cycle_names['theta_out']
        theta = self._cycle_names['theta']
        partials[(theta_out, theta)] = self.make_jacobian_entry(np.array([0.5]), pd_type)
        partials[(theta_out, self._cycle_names['psi'])] = self.make_jacobian_entry(np.array([((- 1) / ((2 * k) - 2))]), pd_type)