Thanks for the update.
I haven’t reproduced the complete issue in libtorch, since you are already manually manipulating the .data attribute (which is not recommended, as it could yield unwanted issues, so wrap the code in a with torch.no_grad() block and assign the new nn.Parameter directly if necessary) and set it into a channels-last format.
As your Python script shows, arr.data.contiguous returns False and also:
print(model.conv1.weight.stride())
> (18, 1, 6, 2)
print(model.conv1.weight.is_contiguous())
> False
print(model.conv1.weight.is_contiguous(memory_format=torch.channels_last))
> True

shows that your manual assignment is setting the weight parameter to channels_last.