I’m looking at https://pytorch.org/tutorials/intermediate/memory_format_tutorial.html 7
Specifically, this example:
    input = torch.randint(1, 10, (2, 8, 4, 4), dtype=torch.float32, device="cuda", requires_grad=True)
    model = torch.nn.Conv2d(8, 5, 3).cuda().float()

    input = input.contiguous(memory_format=torch.channels_last)
    model = model.to(memory_format=torch.channels_last) # Module parameters need to be Channels Last

    out = model(input)
    print(out.is_contiguous(memory_format=torch.channels_last)) # Outputs: True

If I comment out the line that converts model to channels_last format, I expect it to fail, but it does not.
How come input which are in channel_last format can be convolved with weight filters in channel_first format without dim mismatch error:
>>> model.weight.shape
torch.Size([5, 8, 3, 3])
>>> model.weight.is_contiguous(memory_format=torch.channels_last)
False
>>> input.shape
torch.Size([2, 8, 4, 4])
>>> input.is_contiguous(memory_format=torch.channels_last)
True

My understanding is input actual shape in this case is [2, 4, 4, 8], and therefore the weight input channels dim (8) should not match the input channels dim (4).
@VitalyFedyunin ?