Broadcasting and constructors
- Dominant language
- Julia
- Stars
- 54
- Forks
- 37
- Avg merge
- 5h 49m
- Merged PRs (30d)
- 1
Description
There seems to be something weird going on when broadcasting over `Real`:
```julia
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
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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Julia examples for Normal.(m, s) and TwoFields.(...). Read the broadcasting and constructor behavior implicated by the examples, then compare with issue #65. Done means the Normal broadcast no longer produces an unexpected Tracker.Tracked result while the demonstrated TwoFields behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100