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

Fix type stability of Statistics.var with dims. #337

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jul 30, 2020

Fixes #336

@maleadt maleadt added the performance How fast can we go? label Jul 30, 2020
@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #337 into master will increase coverage by 0.01%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #337      +/-   ##
==========================================
+ Coverage   79.44%   79.46%   +0.01%     
==========================================
  Files         156      156              
  Lines        8908     8910       +2     
==========================================
+ Hits         7077     7080       +3     
+ Misses       1831     1830       -1     
Impacted Files Coverage Δ
test/statistics.jl 0.00% <0.00%> (ø)
src/statistics.jl 88.88% <100.00%> (-11.12%) ⬇️
src/pool.jl 79.04% <0.00%> (+1.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2fbf594...ae1283d. Read the comment docs.

@maleadt maleadt merged commit 56a576c into master Jul 30, 2020
@maleadt maleadt deleted the tb/var_type_stabilit branch July 30, 2020 10:40
@jumerckx
Copy link
Contributor

With this, var and std don't work with tuple-typed dims.
e.g.

var(cu(rand(10, 10, 10)), dims=(2, 3))
ERROR: MethodError: no method matching getindex(::Tuple{Int64,Int64,Int64}, ::Tuple{Int64,Int64})
Closest candidates are:
  getindex(::Tuple, ::Int64) at tuple.jl:24
  getindex(::Tuple, ::Real) at tuple.jl:25
  getindex(::Tuple, ::AbstractUnitRange{#s69} where #s69<:Real) at range.jl:290
  ...
Stacktrace:
 [1] _var(::CuArray{Float32,3}, ::Bool, ::Nothing, ::Tuple{Int64,Int64}) at c:\Users\jules\Documents\code\Transformer\Untitled.jl:8
 [2] var(::CuArray{Float32,3}; corrected::Bool, mean::Nothing, dims::Tuple{Int64,Int64}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Statistics\src\Statistics.jl:335
 [3] top-level scope at REPL[1]:1

@maleadt
Copy link
Member Author

maleadt commented Aug 25, 2020

OK, should be fixed in #393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance How fast can we go?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std with dims is not type stable
2 participants