@staticmethod
def _get_value(x):
    """This is used when gradients are computed with autograd and the 
        objective function is an ArrayBox. Same function as in legume.utils, 
        but re-defined here so that this class could also be used independently 
        """
    if str(type(x)) == "<class 'autograd.numpy.numpy_boxes.ArrayBox'>":
        return x._value
    else:
        return x
