(m, x, y)
| 146 | |
| 147 | |
| 148 | def count_softmax(m, x, y): |
| 149 | x = x[0] |
| 150 | batch_size, nfeatures = x.size() |
| 151 | total_exp = nfeatures |
| 152 | total_add = nfeatures - 1 |
| 153 | total_div = nfeatures |
| 154 | total_ops = batch_size * (total_exp + total_add + total_div) |
| 155 | |
| 156 | m.total_ops = torch.Tensor([int(total_ops)]) |
| 157 | |
| 158 | |
| 159 | def count_avgpool(m, x, y): |