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

vcat(Matrix, Matrix, TrackedMatrix) #213

Closed
improbable-22 opened this issue Mar 20, 2018 · 1 comment
Closed

vcat(Matrix, Matrix, TrackedMatrix) #213

improbable-22 opened this issue Mar 20, 2018 · 1 comment

Comments

@improbable-22
Copy link
Contributor

If I attempt to concatenate more than two matrices, not all of them tracked, then I get an error:

using Flux
vcat(rand(2,2), rand(2,2), rand(2,2) |> param)

I see there’s a PR #194 but have not yet managed to see if this version solves the problem.

Here's the complete error message:

julia> vcat(rand(2,2), rand(2,2), rand(2,2) |> param)

ERROR: MethodError: Cannot `convert` an object of type Flux.Tracker.TrackedReal{Float64} to an object of type Float64
This may have arisen from a call to the constructor Float64(...),
since type constructors fall back to convert methods.
Stacktrace:
 [1] macro expansion at ./multidimensional.jl:505 [inlined]
 [2] macro expansion at ./cartesian.jl:64 [inlined]
 [3] macro expansion at ./multidimensional.jl:503 [inlined]
 [4] _unsafe_setindex!(::IndexLinear, ::Array{Float64,2}, ::TrackedArray{…,Array{Float64,2}}, ::UnitRange{Int64}, ::Base.Slice{Base.OneTo{Int64}}) at ./multidimensional.jl:496
 [5] macro expansion at ./multidimensional.jl:488 [inlined]
 [6] _setindex! at ./multidimensional.jl:484 [inlined]
 [7] setindex!(::Array{Float64,2}, ::TrackedArray{…,Array{Float64,2}}, ::UnitRange{Int64}, ::Colon) at ./abstractarray.jl:967
 [8] typed_vcat(::Type{Float64}, ::Array{Float64,2}, ::Array{Float64,2}, ::TrackedArray{…,Array{Float64,2}}, ::Vararg{TrackedArray{…,Array{Float64,2}},N} where N) at ./abstractarray.jl:1148
 [9] vcat(::Array{Float64,2}, ::Array{Float64,2}, ::TrackedArray{…,Array{Float64,2}}) at ./abstractarray.jl:1132

julia> Pkg.status("Flux")
 - Flux                          0.5.1
gustafsson added a commit to gustafsson/Flux.jl that referenced this issue May 2, 2018
gustafsson added a commit to gustafsson/Flux.jl that referenced this issue May 2, 2018
Co-authored-by: improbable22 <improbable+github@gmail.com>

# Conflicts:
#	test/tracker.jl
gustafsson added a commit to gustafsson/Flux.jl that referenced this issue May 2, 2018
Co-authored-by: improbable22 <improbable+github@gmail.com>

# Conflicts:
#	test/tracker.jl
gustafsson added a commit to gustafsson/Flux.jl that referenced this issue May 2, 2018
Co-authored-by: improbable22 <improbable+github@gmail.com>
@MikeInnes
Copy link
Member

Merged with #243 -- thanks 👍

MikeInnes pushed a commit that referenced this issue Jun 20, 2018
Co-authored-by: improbable22 <improbable+github@gmail.com>
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

No branches or pull requests

2 participants