The following snippet allows you to get a sort of gradient_dict:
import torch
net = torch.nn.Linear(2, 3)
x = torch.rand(4, 2).requires_grad_(True)
loss = net(x).sum() ** 2
loss.backward()
grad_dict = {k:v.grad for k, v in zip(net.state_dict(), net.parameters())}
print(grad_dict)