"vscode:/vscode.git/clone" did not exist on "384c83aa9a1f268e5587d5ea1ea9f4c040845167"
Commit 72efb427 authored by Gan Quan's avatar Gan Quan Committed by Minjie Wang
Browse files

[Bugfix] fixes NLTK dependency (#125) and #126 (#131)

parent aa568358
from . import backend
from . import data
# One has to manually import dgl.data; fixes #125
#from . import data
from . import function
from . import nn
......
......@@ -37,7 +37,10 @@ class Index(object):
self._list_data = np.array([int(data)]).astype(np.int64)
except:
try:
self._list_data = np.array(data).astype(np.int64)
data = np.array(data).astype('int64')
if data.ndim != 1:
raise ValueError('Index data must be 1D int64 vector, but got: %s' % str(data))
self._list_data = data
except:
raise ValueError('Error index data: %s' % str(data))
self._user_tensor_data[F.cpu()] = F.zerocopy_from_numpy(self._list_data)
......
......@@ -191,11 +191,16 @@ def test_update_routines():
# send_and_recv
reduce_msg_shapes.clear()
u = th.tensor([0, 0, 0, 4, 5, 6])
v = th.tensor([1, 2, 3, 9, 9, 9])
u = [0, 0, 0, 4, 5, 6]
v = [1, 2, 3, 9, 9, 9]
g.send_and_recv((u, v))
assert(reduce_msg_shapes == {(1, 3, D), (3, 1, D)})
reduce_msg_shapes.clear()
try:
g.send_and_recv([u, v])
assert False
except ValueError:
pass
# pull
v = th.tensor([1, 2, 3, 9])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment