-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero-sized arrays cannot be applied to Dense layers. #2407
Comments
What output would you like here? There is no data, of course:
If you're trying to propagate size information, then see |
The expected output is an array of size |
Also note that the following works as expected. The behavior should be consistent with this.
|
Yes that's not crazy, I suspect that this one could be made to work without too much effort. But there are likely to be many other places where similar things assume nonempty input, and I don't relish the thought of tracking them all down. julia> Conv((2,2), 1=>3)(randn32(10,10,1,0))
ERROR: TaskFailedException
nested task error: ArgumentError: cannot create partitions of length 0
julia> GlobalMeanPool()(randn32(10,0,1,2))
ERROR: DivideError: integer division error |
I have encountered an issue when attempting to apply a zero-sized array to a
Dense
layer in Flux.jl. The operation fails due to a division by zero error, as the layer does not handle zero-sized input arrays correctly.The text was updated successfully, but these errors were encountered: