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

Method parse

graphlearn/python/data/decoder.py:149–163  ·  view source on GitHub ↗
(self, attr_type)

Source from the content-addressed store, hash-verified

147 self._fspec.append_dense(type_name == "float")
148
149 def parse(self, attr_type):
150 if isinstance(attr_type, tuple) or isinstance(attr_type, list):
151 type_name = attr_type[0]
152 bucket_size = attr_type[1] if len(attr_type) >= 2 else None
153 is_multival = attr_type[2] if len(attr_type) >= 3 else False
154 else:
155 type_name = attr_type
156 bucket_size = None
157 is_multival = False
158
159 assert type_name in {"int", "float", "string"}
160
161 if is_multival and type_name != "string":
162 raise ValueError("multi-value attribute must be string type.")
163 return type_name, bucket_size, is_multival
164
165 @property
166 def weighted(self):

Callers 3

_parse_attributesMethod · 0.95
_build_feature_specMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected