(m, x, y)
| 127 | |
| 128 | |
| 129 | def count_bn(m, x, y): |
| 130 | x = x[0] |
| 131 | c_out = y.size(1) |
| 132 | nelements = x.numel() |
| 133 | # subtract, divide, gamma, beta |
| 134 | total_ops = 4 * nelements |
| 135 | |
| 136 | m.total_ops = torch.Tensor([int(total_ops)]) |
| 137 | m.total_params = torch.Tensor([int(c_out) * 2]) |
| 138 | |
| 139 | |
| 140 | def count_relu(m, x, y): |