dmlc--dgl
c9c6171b9f
This reverts commit 33a8bb93bf.
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
24 行
628 B
Python
24 行
628 B
Python
import dgl.data as data
|
|
|
|
def test_minigc():
|
|
ds = data.MiniGCDataset(16, 10, 20)
|
|
g, l = list(zip(*ds))
|
|
print(g, l)
|
|
|
|
def test_data_hash():
|
|
class HashTestDataset(data.DGLDataset):
|
|
def __init__(self, hash_key=()):
|
|
super(HashTestDataset, self).__init__('hashtest', hash_key=hash_key)
|
|
def _load(self):
|
|
pass
|
|
|
|
a = HashTestDataset((True, 0, '1', (1,2,3)))
|
|
b = HashTestDataset((True, 0, '1', (1,2,3)))
|
|
c = HashTestDataset((True, 0, '1', (1,2,4)))
|
|
assert a.hash == b.hash
|
|
assert a.hash != c.hash
|
|
|
|
if __name__ == '__main__':
|
|
test_minigc()
|
|
test_data_hash()
|