Repository navigation
Conversation
|
How would this work if Also, we need the same patch on gatv2. Simply adding a new conditional in |
266475b to
9b794a9
Compare
|
regarding the wrong gradient shape for empty array, do you have any clue why it is happening? ideally the chainrule's projection shouldn't be patched, it should just receive a dx in the correct shape. |
I have absolutely no idea. A hint there is the error only occurs for 0-sized arrays. I think it has something to do with computing gradients and is outside the scope of this package. Edit: Maybe its related to FluxML/Flux.jl#2648 where processing zero-sized array doesn't override an existing cache. I searched Flux.jl, ChainRules.jl (and core), and Zygote.jl and I could not find any suspicious and there is a specific bypass used for |
It could be because of the |
|
could you add the corresponding tests? |
I may have to fix the empty array problem without hacks to Edit: As is, the fix requires a custom version of |
Resolves #637
Fixes 3 problems:
gat_convduring backpropagation, "DimensionMismatch: arrays could not be broadcast to a common size". This could be solved by removing the conditional used to calculateWxi, Wxj:reshape(x, :, size(x, 3))ingat_convcreates incompatible sizes whenxis empty. This PR determines the size using the first two axes ofxinstead.DimensionMismatch: variable with size(x) == (1, 1, 0) cannot have a gradient with size(dx) == (4, 1, 0). This could be fixed by a patch forChainRulesCore.jlfix: Allow arbitrary reshape in projection if array is zero sized JuliaDiff/ChainRulesCore.jl#702Test script: