Skip to content

Instantly share code, notes, and snippets.

@jamesr66a
Created April 12, 2021 20:32
Show Gist options
  • Save jamesr66a/f6dc8f88033bffc4c9c46de3120ac377 to your computer and use it in GitHub Desktop.
Save jamesr66a/f6dc8f88033bffc4c9c46de3120ac377 to your computer and use it in GitHub Desktop.
import torch
c = torch.nn.Conv2d(5, 5, 3).to(memory_format=torch.channels_last)
x = torch.randn(5, 5, 224, 224).to(memory_format=torch.channels_last)
print(c(x).is_contiguous(memory_format=torch.channels_last))
"""
False
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment