Skip to content

Instantly share code, notes, and snippets.

@malfet
Created July 21, 2020 02:39
Show Gist options
  • Save malfet/a8e1d4f3e8409b33cf7f0159384ca192 to your computer and use it in GitHub Desktop.
Save malfet/a8e1d4f3e8409b33cf7f0159384ca192 to your computer and use it in GitHub Desktop.
import torch
def hflip(img: torch.Tensor) -> torch.Tensor: return img.flip(-1)
print(torch.jit.script(hflip)(torch.rand(3, 8, 8)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment