When doing these things, I would recommend to always use sizes that are not equal. Then shape compatibility and comparing the shapes tells you where you have the wrong order.
import torch
import tensorflow
import numpy
y = numpy.random.rand(1,100,100,1)
filterx = numpy.random.rand(4,5,1,2)
a= tensorflow.nn.conv2d(
    y,
    filterx, [1,1,1,1], 'VALID')
with tensorflow.Session() as sess:
  t = (sess.run(a))



x = torch.nn.Conv2d(1,1,5, bias = False)
filter = numpy.transpose(filterx, (3,2,0,1))
x.weight = torch.nn.Parameter(torch.from_numpy(filter))
z = numpy.transpose(y, (0,3,1,2))
l = x(torch.from_numpy(z))
l = l.detach().numpy()
l = numpy.transpose(l,(0,2,3,1))

print(t.shape)
print(l.shape)
print(numpy.abs(t-l).max())

Gives 4e-15 or so, the double precision.
Best regards
Thomas