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

Method _compile

imperative/python/megengine/utils/network.py:96–108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 return self
95
96 def _compile(self):
97 self.all_oprs_map = {}
98 self.all_vars_map = {}
99 for opr in self.all_oprs:
100 if isinstance(opr, (ConstOpBase, Host2DeviceCopy)):
101 opr.compile(self.graph)
102 else:
103 opr.compile()
104 if opr.name is not None:
105 opr._opr.name = opr.name
106 self.all_oprs_map[opr._opr.id] = opr
107 for o in opr.outputs:
108 self.all_vars_map[o.var.id] = o
109
110 def optimize_for_inference(self, dest_vars, **kwargs):
111 r"""Applies optimize_for_inference pass for operator graph.

Callers 5

dumpMethod · 0.95
reset_batch_sizeMethod · 0.95
replace_varsMethod · 0.95
replace_oprsMethod · 0.95
visualizeFunction · 0.80

Calls 1

compileMethod · 0.45

Tested by

no test coverage detected