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

Function get_shape_hash

imperative/python/megengine/jit/partial_tracing.py:175–179  ·  view source on GitHub ↗
(*tensors)

Source from the content-addressed store, hash-verified

173 return rst
174
175 def get_shape_hash(*tensors):
176 def map_scalar_to_tuple(ishape):
177 return (1,) if ishape == tuple() else ishape
178
179 return hash(tuple([map_scalar_to_tuple(t._tuple_shape) for t in tensors]))
180
181 def wrapped_func(*args, **kwargs):
182 from ..traced_module.pytree import tree_flatten

Callers 1

wrapped_funcFunction · 0.85

Calls 2

map_scalar_to_tupleFunction · 0.85
hashFunction · 0.50

Tested by

no test coverage detected