(nodes,
default_int_attr=0,
default_float_attr=0.0,
default_string_attr="")
| 242 | npt.assert_equal(s_attrs[i][0], str(value)) |
| 243 | |
| 244 | def check_not_exist_node_attrs(nodes, |
| 245 | default_int_attr=0, |
| 246 | default_float_attr=0.0, |
| 247 | default_string_attr=""): |
| 248 | size = nodes.ids.size |
| 249 | npt.assert_equal([size, 1], |
| 250 | list(nodes.int_attrs.shape)) # [batch_size, int_num] |
| 251 | npt.assert_equal([size, 1], |
| 252 | list(nodes.float_attrs.shape)) # [batch_size, float_num] |
| 253 | npt.assert_equal([size, 1], |
| 254 | list(nodes.string_attrs.shape)) # [batch_size, string_num] |
| 255 | |
| 256 | if len(nodes.shape) == 2: |
| 257 | total_node = nodes.shape[0] * nodes.shape[1] |
| 258 | else: |
| 259 | total_node = size |
| 260 | |
| 261 | # the second int is hash value, here we just check the first one |
| 262 | check_default_i_attrs(nodes.int_attrs, total_node, default_int_attr) |
| 263 | check_default_f_attrs(nodes.float_attrs, total_node, default_float_attr) |
| 264 | check_default_s_attrs(nodes.string_attrs, total_node, default_string_attr) |
| 265 | |
| 266 | def check_default_i_attrs(i_attrs, count, default_int_attr=0): |
| 267 | npt.assert_equal(i_attrs[:, 0].flatten(), |
nothing calls this directly
no test coverage detected