Nikronic:

conv = conv.to(memory_format=torch.channels_last)
print(conv.weight.shape)
print(conv.weight.stride())



This is the correct way to convert the existing model or layer. Please also make sure you are converting inputs as well
input = input.to(memory_format=torch.channels_last)