-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
WIP: min, max, sum, prod, mean etc on dimensions #2409
Conversation
First pass at implemented the Dim type for JuliaLang#2265. For an array A, you can now call, e.g.: max(A, Dim(1)). The Dim type can be constructed with integers, arrays, ranges, or tuples, so all of the following are valid: Dim(1) Dim(1, 2) Dim([1]) Dim([1,2]) Dim([1 2]) Dim(1:2)
Travis failures don't appear to be your fault. Filing new issues for them. |
with no need for special cases for But I'm not completely sold on the whole |
@stevengj How do I get that to work while also supporting Dim(1, 2, 3...)? |
|
@stevengj Apparently a Range is an AbstractVector. So, if I make just these two outer constructors:
then a call to Dim(1:3) doesn't vectorize the range. |
It probably shouldn't really matter if range isn't vectorized, e.g., julia> z = zeros(2,2,2,2); z[:]=1:16; sum(z, 1:4)
1x1x1x1 Float64 Array:
[:, :, 1, 1] =
136.0 |
Why waste storage by converting a range into an explicit vector of elements? |
On further review, #2411 might actually be caused by this, so please look into that if we're going to pursue this further. |
Fair enough. I'll go ahead and close #2411 to get it off the radar, then. |
I have to say, I really don't care for the |
@StefanKarpinski I'm with you on the |
I also really like the |
"Varm" also means "warm" in Swedish, which gives me an, er, warm and fuzzy feeling. |
@StefanKarpinski: Yeah, that felt pretty funny to me too. Do you know Swedish? |
I do – my mother's from Sweden and it was my first language. |
Aha, där ser man. Fast det är nog bättre att vi pratar engelska här ändå. |
Kanske vi skulle översätta dokumentationen til svenska? Nä... alla svenskar föstår engelska ändå. |
Precis :) |
Also shelves stats changes for later, and simplifies Dim constructors.
Since the max/min solution is still being discussed, I am re-opening this pull request. I've fixed the test failures. If we decide to continue with this approach, I could use a suggestion for a less hacky means of comparing the regions in suitespare.jl's |
Closing, as |
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (JuliaLang#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (JuliaLang#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (JuliaLang#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (JuliaLang#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (JuliaLang#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (JuliaLang#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (JuliaLang#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (JuliaLang#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (JuliaLang#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (JuliaLang#2409) ```
First pass at implementing the
Dim
type from the discussion #2265. For an array A, you can now call, e.g.:max(A, Dim(1))
. TheDim
can be constructed with integers,arrays, ranges, or tuples, so all of the following are valid:
I seem to have broken something with BitArrays which I am yet to figure out.
Still need to modify
cumsum
andcumprod
. All the stats functions need similar updates.