Hi, I’m writing my own Costom Operator Op following the tutorials here: https://github.com/apache/incubator-mxnet/blob/master/example/numpy-ops/custom_softmax.py
I want to change the “in_data” because my custom loss needs the outputs from anther network.
for this moment it has “data” and “label”.
I changed the Data Batch in “forward” of Sequential module. However, when the data_batch was passed into CustomOp, there is only “data” and "label’ part.
I couldn’t figure it out how the data batch was passed from the forward function of Module to the Custom Op.
So ideally I can get another part of data besides data and label by
data = in_data[0]
label = in_data[1]
pred = in_data[2]
when I asked this on Github (This was actually is not a good idea), and I was told
I can pass more arguments like following:
mx.sym.Custom([a, b, c, d, e], …)
mx.nd.Custom([a, b, c, d, e], …)
in which a = in_data[0], b = in_data[1], c = in_data[2], d = in_data[3], e = in_data[4].
But here because I write my own Module and was going to pass the data directly to the forward function in Module, but not “outside”.
Maybe I missed something?
Can anyone give me some advice. Thank you.