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

Function REG

src/gopt/impl/basic_arith/inplace.cpp:178–183  ·  view source on GitHub ↗

a ** 0 => 1, a ** 1 => a

Source from the content-addressed store, hash-verified

176
177 // a ** 0 => 1, a ** 1 => a
178 REG(EXP) {
179 if (is_const_value(inp[0], 0)) {
180 return inp[0].fill_retain_dtype(1);
181 }
182 return {};
183 };
184 REG(POW) {
185 auto a = inp[0];
186 auto exp = inp[1].as_immutable_scalar();

Callers 3

init_dispatch_tableMethod · 0.85
indexing.cppFile · 0.85
reg_allMethod · 0.85

Calls 15

is_const_valueFunction · 0.85
almost_equalFunction · 0.85
broadcast_tshpFunction · 0.85
as_elem_oprFunction · 0.85
swapFunction · 0.85
broadcast_ensureFunction · 0.85
as_immutable_scalarMethod · 0.80
make_scalar_dtMethod · 0.80
categoryMethod · 0.80
makeFunction · 0.50
validMethod · 0.45
nodeMethod · 0.45

Tested by

no test coverage detected