wrapper for gradient