No its a problem (on pytorch side, not your code) in the way backward engine computes dependencies.
Its triggered by the fact that you use the max_index from the max operation that is not differential.
You can use the workaround until this issue 215 is solved.