Hi,
Indeed the gradients are only checked for the Tensors that are explicit inputs to the function. So if none of them requires gradients, that means that no gradient needs to be checked.
You will need to give theta as an input to your function to be able to use gradcheck I’m afraid.