documentation for grid, grad_output