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

Method scratch_size_of_pooling

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

Source from the content-addressed store, hash-verified

146 return None
147
148 def scratch_size_of_pooling(self, op_def):
149 input0_dims = self.get_op_input_dims(op_def, 0)
150 channels = input0_dims[3]
151 mace_check(channels > 0, "can not inference pooling's input shape.")
152
153 int_bytes = self.get_data_bytes(mace_pb2.DT_INT32)
154 float_bytes = self.get_data_bytes(mace_pb2.DT_FLOAT)
155
156 return channels * (int_bytes + float_bytes)
157
158 def scratch_size_of_depthwise_conv(self, op_def):
159 if (ModelKeys.quantize in self.model_conf

Callers

nothing calls this directly

Calls 3

get_op_input_dimsMethod · 0.95
get_data_bytesMethod · 0.95
mace_checkFunction · 0.90

Tested by

no test coverage detected