MCPcopy Create free account
hub / github.com/alibaba/graph-learn / check_attrs

Method check_attrs

graphlearn/python/tests/test_node.py:63–72  ·  view source on GitHub ↗
(self, nodes)

Source from the content-addressed store, hash-verified

61 self.assertEqual(8, nodes.labels[2])
62
63 def check_attrs(self, nodes):
64 self.assertListEqual([3, 2], list(nodes.int_attrs.shape)) # [int_num, batch_size]
65 self.assertListEqual([3, 1], list(nodes.float_attrs.shape)) # [float_num, batch_size]
66 self.assertListEqual([3, 1], list(nodes.string_attrs.shape)) # [string_num, batch_size]
67
68 for i, value in zip(range(3), self.ids_):
69 # the second int is hash value, here we just check the first one
70 self.assertEqual(nodes.int_attrs[i][0], value)
71 self.assertEqual(nodes.float_attrs[i][0], float(value))
72 self.assertEqual(nodes.string_attrs[i][0], str(value))

Callers 4

test_attributedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected