MCPcopy Create free account
hub / github.com/alibaba/euler / Serialize

Method Serialize

euler/tools/node.py:82–113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

80 return groups_idx, neighbor, weight, type_ids, type_weights
81
82 def Serialize(self):
83 s = b''
84 s += write_correct_data('uint64_t', self.id)
85 s += write_correct_data('int32_t', self.type)
86 s += write_correct_data('float', self.weight)
87
88 g_idx, n, w, t_ids, t_wei = self.convert_neighbor(self.neighbor)
89 s += write_list(t_ids, 'int32_t')
90 s += write_list(t_wei, 'float')
91 s += write_list(g_idx, 'int32_t')
92 s += write_list(n, 'uint64_t')
93 s += write_list(w, 'float')
94
95 g_idx, n, w, t_ids, t_wei = self.convert_neighbor(self.in_neighbor)
96 s += write_list(t_ids, 'int32_t')
97 s += write_list(t_wei, 'float')
98 s += write_list(g_idx, 'int32_t')
99 s += write_list(n, 'uint64_t')
100 s += write_list(w, 'float')
101
102 f_idx, f = convert_feature(self.sparse)
103 s += write_list(f_idx, 'int32_t')
104 s += write_list(f, 'uint64_t')
105
106 f_idx, f = convert_feature(self.dense)
107 s += write_list(f_idx, 'int32_t')
108 s += write_list(f, 'float')
109
110 f_idx, f = convert_feature(self.binary)
111 s += write_list(f_idx, 'int32_t')
112 s += write_string(''.join(f))
113 return s

Callers

nothing calls this directly

Calls 5

convert_neighborMethod · 0.95
write_correct_dataFunction · 0.85
write_listFunction · 0.85
convert_featureFunction · 0.85
write_stringFunction · 0.85

Tested by

no test coverage detected