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

Use new public feature #2342

Merged
merged 3 commits into from
Dec 1, 2023
Merged

Use new public feature #2342

merged 3 commits into from
Dec 1, 2023

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Oct 9, 2023

This marks un-exported symbols public, using a new feature of Julia 1.11.

One use is that Flux.mse can be found by tab completion, etc:

julia> Flux.m  # <tab>
mae               make_causal_mask  maxpool
maxpool!          meanpool          meanpool!
mish              modules           mse
msle              multigate

julia> Flux.one  # Flux.o<tab>
onecold
onehot
onehotbatch
ones32

Not certain the list here is complete.

Comment on lines +86 to +89
@compat(public, (
# init
glorot_uniform,
glorot_normal,
Copy link
Member Author

Choose a reason for hiding this comment

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

I called the macro with brackets just to allow comments like this. But eventual syntax is just public glorot_uniform, glorot_normal like using, for which this isn't possible.

Copy link
Member

Choose a reason for hiding this comment

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

I will express a slight personal preference for this over the indent-only syntax on L60-62, but the best way to settle the debate might be to see what the auto-formatter outputs.

Copy link
Member Author

Choose a reason for hiding this comment

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

All now switched to this format.

@mcabbott
Copy link
Member Author

The autoformatter's opinion is that with two brackets this needs four spaces:

Screenshot 2023-11-28 at 11 22 30

... and that with no brackets, no indent:

Screenshot 2023-11-28 at 11 22 48

@mcabbott mcabbott merged commit ed5a3b8 into FluxML:master Dec 1, 2023
5 of 8 checks passed
@mcabbott mcabbott deleted the public branch January 3, 2024 14:11
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.

2 participants