Yes, gradcheck only works for torch.Tensor.
You can simply modify your function by changing return np.array([g0]) to return g0.
And make sure you give a Tensor (double is better for precision reasons) as input.