grad method for GpuContiguous