I am sorry but I am not a pytorch dev so can’t really help with support thing. I usually use .contiguous() whenever the data points are sliced or permuted and hence not consecutive. torch.tanh won’t cause a problem as long as the data points are consecutive.
One possible solution is to may be permute the axes such that the values which would have the same non-linearity are consecutive. So in your case it would be something like
x1 = x.permute(0, 2, 3, 1).contiguous()
print(torch.tanh(x1))
print(torch.tanh(x1[:, :, :, -1]))
print(torch.tanh(x1[:, :, :, -1].contiguous()))

The last two lines would return the same result