Skip to content

Commit

Permalink
fix test to reflect #81
Browse files Browse the repository at this point in the history
torch.autograd.variable.Variable => torch.autograd.Variable
  • Loading branch information
lanpa committed Feb 15, 2018
1 parent 9336ec8 commit 54975fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_pytorch_np.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ def test_pytorch_np():
assert isinstance(x2num.makenp(tensor.cuda()), np.ndarray)

# regular variable
assert isinstance(x2num.makenp(torch.autograd.variable.Variable(tensor)), np.ndarray)
assert isinstance(x2num.makenp(torch.autograd.Variable(tensor)), np.ndarray)

# CUDA variable
if torch.cuda.device_count()>0:
assert isinstance(x2num.makenp(torch.autograd.variable.Variable(tensor).cuda()), np.ndarray)
assert isinstance(x2num.makenp(torch.autograd.Variable(tensor).cuda()), np.ndarray)

# python primitive type
assert(isinstance(x2num.makenp(0), np.ndarray))
Expand All @@ -32,4 +32,4 @@ def test_pytorch_img():

def test_pytorch_write():
with SummaryWriter() as w:
w.add_scalar('scalar', torch.autograd.variable.Variable(torch.rand(1)), 0)
w.add_scalar('scalar', torch.autograd.Variable(torch.rand(1)), 0)

0 comments on commit 54975fa

Please sign in to comment.