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

Function is_scalar_shape

imperative/src/impl/transformations/scalar.cpp:22–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool is_scalar_shape(ValueRef shape) {
23 // may have performance issue
24 auto shape_of_shape = shape.shape();
25 if (!shape_of_shape) {
26 // assume not scalar
27 return false;
28 }
29 return *shape_of_shape == ValueShape{0};
30}
31
32template <
33 typename T,

Callers 3

reduce_ruleFunction · 0.85
reshape_ruleFunction · 0.85
broadcast_ruleFunction · 0.85

Calls 1

shapeMethod · 0.45

Tested by

no test coverage detected