Closed GaiYu0 closed 7 years ago
Hi! Here is an example of the issue:
from mxnet.symbol import Group, Variable
p = Variable('p')
q = Variable('q')
group = Group((p, q))
from minpy.core import Function
function = Function(group, input_shapes={'p' : (1,), 'q' : (1,)})
def f(p, q):
p, q = function(p=p, q=q)
return p - q
from minpy.core import grad
df = grad(f, range(2))
import minpy.numpy as np
p = np.ones((1,))
q = np.zeros((1,))
df(p, q)
Exception raised:
@GaiYu0 This should be closed?
I agree. Let me close the issue.
Hi! I am using
minpy.core.Function
to call a MXNet symbol yielding multiple outputs. I am not sure whetherminpy.core.Function
works in backward phase if there are top-down gradients w.r.t. all these outputs.It appears that
minpy.core.Function
only provides gradient w.r.t. one of these outputs to executor.backward: https://github.com/dmlc/minpy/blob/master/minpy/core.py#L169(But I might be wrong)