(axes_and_scalars, device)
| 1 | import torch |
| 2 | |
| 3 | def generate_inputs(axes_and_scalars, device): |
| 4 | M = axes_and_scalars['M'] |
| 5 | N = axes_and_scalars['N'] |
| 6 | K = axes_and_scalars['K'] |
| 7 | grad_output = torch.randn(M, N, dtype=torch.float32, device=device) / N ** 0.5 |
| 8 | x = torch.randn(M, K, dtype=torch.float32, device=device) / K ** 0.5 |
| 9 | weight = torch.randn(N, K, dtype=torch.float32, device=device) / K ** 0.5 |
| 10 | return {'grad_output': grad_output, 'x': x, 'weight': weight} |
| 11 | |
| 12 | @torch.no_grad() |
| 13 | def run(grad_output, x, weight): |
nothing calls this directly
no outgoing calls
no test coverage detected