(op)
| 153 | |
| 154 | |
| 155 | def count_pool2d(op): |
| 156 | input_shape = op.inputs("X")[0].shape() |
| 157 | output_shape = op.outputs('Out')[0].shape() |
| 158 | kernel = np.array(input_shape[2:]) // np.array(output_shape[2:]) |
| 159 | total_add = np.prod(kernel) |
| 160 | total_div = 1 |
| 161 | kernel_ops = total_add + total_div |
| 162 | num_elements = np.prod(output_shape[1:]) |
| 163 | total_ops = kernel_ops * num_elements |
| 164 | total_ops = abs(total_ops) |
| 165 | return total_ops |
| 166 | |
| 167 | |
| 168 | def count_element_op(op): |
no test coverage detected