(self, op_def)
| 92 | mace_check(False, "Invalid data type: %s" % data_type) |
| 93 | |
| 94 | def scratch_size_conv(self, op_def): |
| 95 | if (ModelKeys.quantize in self.model_conf |
| 96 | and self.model_conf[ModelKeys.quantize] == 1): |
| 97 | output_channels = op_def.output_shape[0].dims[3] |
| 98 | cmsis_bias_bytes = \ |
| 99 | self.get_data_bytes(mace_pb2.DT_INT32) * output_channels |
| 100 | |
| 101 | input_dims = self.get_op_input_dims(op_def, 0) |
| 102 | filter_dims = self.get_op_input_dims(op_def, 1) |
| 103 | cmsis_nn_buffer_bytes = \ |
| 104 | 2 \ |
| 105 | * input_dims[3] \ |
| 106 | * filter_dims[2] \ |
| 107 | * filter_dims[1] \ |
| 108 | * self.get_data_bytes(mace_pb2.DT_INT16) |
| 109 | |
| 110 | return cmsis_nn_buffer_bytes + cmsis_bias_bytes |
| 111 | else: |
| 112 | return 0 |
| 113 | |
| 114 | def scratch_size_of_expand_dims(self, op_def): |
| 115 | output_dim_size = len(op_def.output_shape[0].dims) |
nothing calls this directly
no test coverage detected