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

Inference failures on 0.7 #92

Open
iamed2 opened this issue Jun 23, 2017 · 2 comments
Open

Inference failures on 0.7 #92

iamed2 opened this issue Jun 23, 2017 · 2 comments

Comments

@iamed2
Copy link
Collaborator

iamed2 commented Jun 23, 2017

Indexing: Error During Test
  Test threw an exception of type ErrorException
  Expression: @inferred(D[1, 1, 1, :]) == @inferred(D[1, 1, 1, 1:1]) == @inferred(D[1, 1, 1, [1]]) == AxisArray([10], Axis{:dim_4}(Base.OneTo(1)))
  return type AxisArrays.AxisArray{Int64,1,Array{Int64,1},Tuple{AxisArrays.Axis{:dim_4,Base.OneTo{Int64}}}} does not match inferred return type AxisArrays.AxisArray{Int64,1,Array{Int64,1},_} where _

There are others but this one is the simplest (found by running AxisArrays master tests on JuliaLang master).

@iamed2
Copy link
Collaborator Author

iamed2 commented Jun 25, 2017

@vtjnash has given me a tentative "won't fix" but pointed me to some examples on how this issue was fixed in Base.

@martinholters
Copy link

martinholters commented Jun 27, 2017

I've taken a brief look and the collector argument newaxes in _make_axes_match seems to be the problem. (And handling of such collector arguments is what likely won't be changed in the inference algorithm.) It's relatively easy to avoid using it, except for

@inline _make_axes_match(newaxes, axs::Tuple{}, nidxs::Tuple) =
    _make_axes_match((newaxes..., _nextaxistype(newaxes)(Base.OneTo(1))), (), tail(nidxs))

where it is, in fact, more than just a collector argument. Is there a way to write the generation of the singleton dimensions in a back-to-front manner, so that (only) a shrinking (instead of a growing) Tuple is passed?

EDIT: Similar situation for _default_axes and its axs argument.

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