Вы можете следить за обсуждением здесь
Суть в том, что не все операторы в настоящее время поддерживают градиенты более высокого порядка.
В Gluon вы можете попробовать следующее:
with mx.autograd.record():
output = net(x)
loss = loss_func(output)
dz = mx.autograd.grad(loss, [z], create_graph=True) # where [z] is the parameter(s) you want
dz[0].backward() # now the actual parameters should have second order gradients
Взято из этой ветки форума