(m, x, y)
| 178 | |
| 179 | |
| 180 | def count_linear(m, x, y): |
| 181 | # per output element |
| 182 | total_mul = m.in_features |
| 183 | total_add = m.in_features - 1 |
| 184 | num_elements = y.numel() |
| 185 | total_ops = (total_mul + total_add) * num_elements |
| 186 | |
| 187 | m.total_ops = torch.Tensor([int(total_ops)]) |
| 188 | m.total_params = torch.Tensor([m.in_features * m.out_features]) |
| 189 | |
| 190 | |
| 191 | register_hooks = { |
nothing calls this directly
no outgoing calls
no test coverage detected