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

Method get_op_input_dims

tools/python/micro/scratch_computer.py:137–146  ·  view source on GitHub ↗
(self, op_def, idx)

Source from the content-addressed store, hash-verified

135 return output_dim_bytes
136
137 def get_op_input_dims(self, op_def, idx):
138 input_name = op_def.input[idx]
139 for const_tensor in self.net_def.tensors:
140 if input_name == const_tensor.name:
141 return const_tensor.dims
142 for pre_op in self.net_def.op:
143 for i in range(len(pre_op.output)):
144 if pre_op.output[i] == input_name:
145 return pre_op.output_shape[i].dims
146 return None
147
148 def scratch_size_of_pooling(self, op_def):
149 input0_dims = self.get_op_input_dims(op_def, 0)

Callers 6

scratch_size_convMethod · 0.95
scratch_size_eltwiseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected