It is used to find nan and other issues in the backward pass.
It was using specific functions to do that detection that were not supported by sparse Tensors hence the issue.
But your error is not related as we don’t use gt() in there.
This error just means that this function is not implemented for sparse Tensors and you cannot use it.