':param loss: Symbolic expression for the loss function.
:param target: A parameterized object to optimize over. It should implement methods of the
:class:`rllab.core.paramerized.Parameterized` class.
:param leq_constraint: A constraint provided as a tuple (f, epsilon), of the form f(*inputs) <= epsilon.
:param inputs: A list of symbolic variables as inputs
:return: No return value.'

def update_opt(self, loss, target, inputs, extra_inputs=None, *args, **kwargs):

    self._target = target
    def get_opt_output():
        flat_grad = tensor_utils.flatten_tensor_variables(tf.gradients(loss, target.get_params(trainable=True)))
        return [tf.cast(loss, tf.float64), tf.cast(flat_grad, tf.float64)]
    if (extra_inputs is None):
        extra_inputs = list()
    self._opt_fun = ext.lazydict(f_loss=(lambda : tensor_utils.compile_function((inputs + extra_inputs), loss)), f_opt=(lambda : tensor_utils.compile_function(inputs=(inputs + extra_inputs), outputs=get_opt_output())))
