MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / _parse_var_as_value

Function _parse_var_as_value

imperative/python/megengine/xla/rules/utils.py:85–92  ·  view source on GitHub ↗
(var)

Source from the content-addressed store, hash-verified

83
84
85def _parse_var_as_value(var):
86 assert isinstance(
87 var.bound_data, (np.ndarray, int)
88 ), "cannot parse a non-const var as value"
89 if tuple(var.bound_data.shape) == (1,):
90 return int(var.bound_data)
91 else:
92 return var.bound_data
93
94
95def _can_broadcast_to(src, dst, broadcast_dims=None):

Callers 1

split_lowerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected