Skip to content

Instantly share code, notes, and snippets.

@vaibkumr
Created October 11, 2019 17:44
Show Gist options
  • Save vaibkumr/ed0eb37189e56b8403d37b08c5a84280 to your computer and use it in GitHub Desktop.
Save vaibkumr/ed0eb37189e56b8403d37b08c5a84280 to your computer and use it in GitHub Desktop.
import torch
# Binary operator on named tensors
t1 = torch.randn(4, names=('X'))
t2 = torch.randn(4)
t3 = t1 * t2
t3.names #output: ('X',)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment