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

Function apply_expr

imperative/python/megengine/core/tensor/utils.py:173–181  ·  view source on GitHub ↗
(op, *args, nr_out=None)

Source from the content-addressed store, hash-verified

171 builder = _SubgraphBuilder(name)
172
173 def apply_expr(op, *args, nr_out=None):
174 op = as_op(op, len(args))
175 results = builder.apply(op, args, 1 if nr_out is None else nr_out)
176 if nr_out is None:
177 assert len(results) == 1
178 return results[0]
179 else:
180 assert len(results) == nr_out
181 return results
182
183 def apply_const(value, dtype=dtype, device=device):
184 return builder.apply_const(value, dtype, device)

Callers

nothing calls this directly

Calls 3

as_opFunction · 0.85
applyFunction · 0.50
applyMethod · 0.45

Tested by

no test coverage detected