Skip to content

Instantly share code, notes, and snippets.

@iamalbert
Last active January 23, 2017 02:51
Show Gist options
  • Save iamalbert/39d5cb91de1eeb2073b44e7eab7f8ae7 to your computer and use it in GitHub Desktop.
Save iamalbert/39d5cb91de1eeb2073b44e7eab7f8ae7 to your computer and use it in GitHub Desktop.
import torch
from torch.autograd import Variable as V
import numpy as np
a = V( torch.from_numpy( np.asarray([1.112]) ) ).float()
b = V( torch.rand(1) )
c = a + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment