No, my comment was about the class, not the __hash__ method.

This op do not implement the grad() method. I don't think we need to support it. But if you can explain why clearly, adding a comment to this would help future people reading it. You could put this in the docstring of the class. What about something like:

"""
This class don't need the grad() method, as we don't do gradient on indices as they are integer values
"""

I let you decide about this.