MCPcopy Create free account
hub / github.com/XiaoMi/mace / init_output_cache

Method init_output_cache

tools/python/micro/graph_builder.py:27–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25 self.init_model_input_cache()
26
27 def init_output_cache(self):
28 model_outputs = []
29 for output_info in self.net_def.output_info:
30 model_outputs.append(output_info.name)
31 self.output_cache = {}
32 self.output_infos = []
33 for i in range(len(self.net_def.op)):
34 op_def = self.net_def.op[i]
35 for k in range(len(op_def.output)):
36 tensor_name = op_def.output[k]
37 output_info_uint = ((i & 0x0000ffff) << 16) | (k & 0x0000ffff)
38 if tensor_name in model_outputs:
39 self.output_infos.append(output_info_uint)
40 else:
41 self.output_cache[tensor_name] = output_info_uint
42
43 def init_const_tensor_cache(self):
44 self.const_tensor_cache = {}

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected