Since you now consider a 1D -> 1D function. You need to make sure to view your inputs the right way before/after the formula.
And so her you want to flatten grad_h_relu before the dot product and make sure to view the 1D result as the 2D Tensor you want.

I don’t know if this forum is the right to place to discuss this or not

It definitely is