forked from JuliaGPU/CUDA.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
statistics.jl
28 lines (25 loc) · 876 Bytes
/
statistics.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Statistics
@testset "std" begin
@test testf(std, rand(10))
@test testf(std, rand(10,1,2))
@test testf(std, rand(10,1,2); corrected=true)
@test testf(std, rand(10,1,2); dims=1)
end
@testset "var" begin
@test testf(var, rand(10))
@test testf(var, rand(10,1,2))
@test testf(var, rand(10,1,2); corrected=true)
@test testf(var, rand(10,1,2); dims=1)
@test testf(var, rand(10,1,2); dims=[1])
@test testf(var, rand(10,1,2); dims=(1,))
@test testf(var, rand(10,1,2); dims=[2,3])
@test testf(var, rand(10,1,2); dims=(2,3))
end
@testset "mean" begin
@test testf(mean, rand(2,2))
@test testf(mean, rand(2,2); dims=2)
@test testf(mean, rand(2,2,2); dims=[1,3])
@test testf(x->mean(sin, x), rand(2,2))
@test testf(x->mean(sin, x; dims=2), rand(2,2))
@test testf(x->mean(sin, x; dims=[1,3]), rand(2,2,2))
end