(g, layer, batch_averaged)
| 169 | |
| 170 | @staticmethod |
| 171 | def linear(g, layer, batch_averaged): |
| 172 | # g: batch_size * out_dim |
| 173 | batch_size = g.size(0) |
| 174 | |
| 175 | if batch_averaged: |
| 176 | cov_g = g.t() @ (g * batch_size) |
| 177 | else: |
| 178 | cov_g = g.t() @ (g / batch_size) |
| 179 | return cov_g |
nothing calls this directly
no outgoing calls
no test coverage detected