Your initialization might be “unlucky”, as I’ve got some valid gradients in a couple of iterations (I also got a full zero gradient output):
tensor([[ 0.0000,  0.0000,  0.0000],
        [ 6.8986, 10.3479, 10.3479],
        [ 0.0000,  0.0000,  0.0000],
        [13.0105, 19.5157, 19.5157],
        [ 8.8299, 13.2449, 13.2449]])
tensor([0.0000, 3.4493, 0.0000, 6.5052, 4.4150])

Note that, torch.max will return a 1 gradient for the max value and 0s everywhere else.
Based on the input and your calculations you might end up removing the gradient in the last operation.