Skip to content
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

Fix function _size_check() #2472

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Conversation

gruberchr
Copy link
Contributor

The previous check d > 0 and the corresponding error message didn't make sense if d was the dimension to be checked. It would make sense to check that the difference between the available number of dimensions and the desired dimension is greater than or equal to zero, i.e., ndims(x) - d >= 0 or d <= ndims() respectively.

Moreover, checking for d > 0 is rather pointless, since all implemented checks set d > 0.

A corrected implementation is provided in this PR, which should fix this issue.

src/layers/basic.jl Outdated Show resolved Hide resolved
Copy link
Member

@pxl-th pxl-th left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion, other than that, it is good to go.

Co-authored-by: Anton Smirnov <tonysmn97@gmail.com>
@CarloLucibello CarloLucibello merged commit 942c6e5 into FluxML:master Jul 31, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants