FluxML / FluxML/Tracker.jl

Behavior on `vcat` of scalars

Open
#172 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Julia
Stars
54
Forks
37
Avg merge
5h 49m
Merged PRs (30d)
1

Description

Here's an inconsistency I discovered based on two ways of constructing vectors from floats:
```julia
julia> using Tracker

julia> f1(x) = [x, x];

julia> f2(x) = vcat(x, x);

julia> x = 1.0;

julia> dy = ones(2);

julia> y1, pb1 = Tracker.forward(f1, x);

julia> y2, pb2 = Tracker.forward(f2, x);

julia> y1 == y2
true

julia> pb1(dy) == pb2(dy)
false

julia> pb1(dy) # returns a scalar
(2.0,)

julia> pb2(dy) # returns an array
([2.0],)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the examples using Tracker.forward with f1(x) = [x, x] and f2(x) = vcat(x, x), then trace how each expression constructs its pullback. Compare the returned scalar and array gradients and determine the intended consistent behavior; the issue does not name source files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.