Closed
Description
I need to calculate the pullback of a function which uses unique()
. The variable being differentiated isn't fed into unique()
as an argument. On the forward pass everything seems fine, but on the backwards pass Zygote sets the output of unique()
to IRTools.Inner.Undefined()
. Here is the MWE:
function f1(A)
@show unique([1])
A
end
f1(5) #unique returns correct result
Zygote._pullback(f1,5) #unique returns IRTools.Inner.Undefined()
In the above example Zygote is able to correctly calculate both pullbacks, but in the program I am working on, IRTools.Inner.Undefined()
leads to an error, which causes the whole thing to crash. For the rest of the code to work, I need to keep unique()
in.
Has anyone encountered this issue? What is the fix?
Metadata
Metadata
Assignees
Labels
No labels