fix #36
This commit is contained in:
parent
4266c2e7aa
commit
3e477fcf18
@ -29,7 +29,7 @@ def cuda(x, grad=False, gpu_id=-1):
|
|||||||
t.requires_grad=grad
|
t.requires_grad=grad
|
||||||
return t
|
return t
|
||||||
else:
|
else:
|
||||||
t = T.FloatTensor(x.pin_memory()).cuda(gpu_id, async=True)
|
t = T.FloatTensor(x.pin_memory()).cuda(gpu_id)
|
||||||
t.requires_grad=grad
|
t.requires_grad=grad
|
||||||
return t
|
return t
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ def cudavec(x, grad=False, gpu_id=-1):
|
|||||||
t.requires_grad = grad
|
t.requires_grad = grad
|
||||||
return t
|
return t
|
||||||
else:
|
else:
|
||||||
t = T.Tensor(T.from_numpy(x).pin_memory()).cuda(gpu_id, async=True)
|
t = T.Tensor(T.from_numpy(x).pin_memory()).cuda(gpu_id)
|
||||||
t.requires_grad = grad
|
t.requires_grad = grad
|
||||||
return t
|
return t
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ def cudalong(x, grad=False, gpu_id=-1):
|
|||||||
t.requires_grad = grad
|
t.requires_grad = grad
|
||||||
return t
|
return t
|
||||||
else:
|
else:
|
||||||
t = T.LongTensor(T.from_numpy(x.astype(np.long)).pin_memory()).cuda(gpu_id, async=True)
|
t = T.LongTensor(T.from_numpy(x.astype(np.long)).pin_memory()).cuda(gpu_id)
|
||||||
t.requires_grad = grad
|
t.requires_grad = grad
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -22,7 +22,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
|
|||||||
setup(
|
setup(
|
||||||
name='dnc',
|
name='dnc',
|
||||||
|
|
||||||
version='1.0.0',
|
version='1.0.1',
|
||||||
description='Differentiable Neural Computer, for Pytorch',
|
description='Differentiable Neural Computer, for Pytorch',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user