Skip to content

Instantly share code, notes, and snippets.

@vaibkumr
Created October 11, 2019 17:37
Show Gist options
  • Save vaibkumr/c43b8d169ac5c85be4783380bed34ad1 to your computer and use it in GitHub Desktop.
Save vaibkumr/c43b8d169ac5c85be4783380bed34ad1 to your computer and use it in GitHub Desktop.
import torch
# Unary operator on named tensors
t = torch.randn(4, 2, names=('N', 'C'))
t = t.abs()
t.names #output: ('N', 'C')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment