Skip to content

Broadcasting and constructors  #119

Open
@torfjelde

Description

@torfjelde

There seems to be something weird going on when broadcasting over Real:

julia> using Tracker, Distributions

julia> m = first(param(zeros(1)))
0.0 (tracked)

julia> s = first(param(ones(1)))
1.0 (tracked)

julia> typeof(Normal.(m, s))
Tracker.Tracked{Normal{Float64}}

But the strange thing is that the following seems to work just fine:

julia> struct TwoFields{T1,T2}
           x::T1
           y::T2
       end

julia> TwoFields.(first(param(zeros(1))), first(param(zeros(1))))
TwoFields{Float64, Float64}(0.0, 0.0)

Possibly related to: #65

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions