It seems that tensor I and delta are not wrapped into the computational graph, thus their grad is None.
I have a dummy code here to explain it
a = torch.randn(3,3,)
b = torch.randn(3,3,)
c = a + b
a.requires_grad_()
b.requires_grad_()
c.requires_grad_()
c.sum().backward()

a.grad -> None
b.grad -> None

But you set requires_grad_() at first, like
a = torch.randn(3,3, requires_grad=True)

the grad of pert will be None, and the grad of delta and I will be None. Because here pert is non-leaf tensor, its gradient will not be stored.