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

add .~ notation #177

Merged
merged 1 commit into from
Aug 31, 2020
Merged

add .~ notation #177

merged 1 commit into from
Aug 31, 2020

Conversation

cscherrer
Copy link
Owner

This one-line update (obvious in retrospect) lets us do things like

julia> m = @model begin
       x .~ Normal.(rand(4))
       end;

julia> m
@model begin
        x ~ For(identity, Normal.(rand(4)))
    end


julia> rand(m())
(x = [0.3757908068715139, 1.7752927895608144, 0.13911698109223786, -0.1342542512198157],)

as discussed (two years ago!) in #14

@DilumAluthge I think this will also be useful for our MLJBase.UnivariateFinite manipulations

@cscherrer cscherrer linked an issue Aug 31, 2020 that may be closed by this pull request
@cscherrer cscherrer merged commit 9d4c006 into master Aug 31, 2020
@cscherrer cscherrer deleted the cs-broadcasted-sampling branch August 31, 2020 19:27
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.

use comprehensions instead of For(1:N)?
2 participants