Hi, so if by sensitivity you mean, how sensible is the output to changes in the input (e.g the gradients). Then something like this could work:
>>> inp = torch.randn(5)
>>> 

>>> inp.requires_grad_()
tensor([-0.1457,  0.1341,  0.6884, -1.9446, -0.2557], requires_grad=True)
>>> x = inp * 7 
>>> x = x/10
>>> out = torch.exp(x)
>>> out.sum().backward()
>>> inp.grad
tensor([0.6321, 0.7689, 1.1334, 0.1794, 0.5853])

Also, one clarification, you normally don’t compute the sensitivity of the loss function with respect to the input, but rather, to the model’s parameters. Hope, this helps