from mxnet import autograd,nd
x=nd.arange(4).reshape((4,1))
print(x)
x.attach_grad()
with autograd.record():
y=2*nd.dot(x.T,x)
y.backward()
print(x.grad)

from mxnet import autograd,nd
x=nd.arange(4).reshape((4,1))
print(x)
x.attach_grad()
with autograd.record():
y=2*nd.dot(x.T,x)
y.backward()
print(x.grad)


被折叠的 条评论
为什么被折叠?