I have a function that I want to take the gradient of in the end. I want to achive that a certain variable is deemed independent of the variable i wish to differentiate in the the end. I tried to do this with the Zygote.ignore() function but this does not seem to work:
function test(A)
Zygote.ignore() do
B = A
end
c = norm(A*B)
return c
end
A = rand(5,5)
test(A)
Here I would in the end take the gradient with respect to A…
This seems to create B only as a local variable within the “do-Block”. Is there a way around this?