text
stringlengths
12
786k
let test_i0e ( ) = Alcotest . ( check bool ) " test i0e " true ( To_test . test_i0e ( ) )
let test_i1 ( ) = Alcotest . ( check bool ) " test i1 " true ( To_test . test_i1 ( ) )
let test_i1e ( ) = Alcotest . ( check bool ) " test i1e " true ( To_test . test_i1e ( ) )
let test_iv ( ) = Alcotest . ( check bool ) " test iv " true ( To_test . test_iv ( ) )
let test_k0 ( ) = Alcotest . ( check bool ) " test k0 " true ( To_test . test_k0 ( ) )
let test_k0e ( ) = Alcotest . ( check bool ) " test k0e " true ( To_test . test_k0e ( ) )
let test_k1 ( ) = Alcotest . ( check bool ) " test k1 " true ( To_test . test_k1 ( ) )
let test_k1e ( ) = Alcotest . ( check bool ) " test k1e " true ( To_test . test_k1e ( ) )
let test_airy ( ) = Alcotest . ( check bool ) " test airy " true ( To_test . test_airy ( ) )
let test_ellipj ( ) = Alcotest . ( check bool ) " test ellipj " true ( To_test . test_ellipj ( ) )
let test_ellipk ( ) = Alcotest . ( check bool ) " test ellipk " true ( To_test . test_ellipk ( ) )
let test_ellipkm1 ( ) = Alcotest . ( check bool ) " test ellipkm1 " true ( To_test . test_ellipkm1 ( ) )
let test_ellipkinc ( ) = Alcotest . ( check bool ) " test ellipkinc " true ( To_test . test_ellipkinc ( ) )
let test_ellipe ( ) = Alcotest . ( check bool ) " test ellipe " true ( To_test . test_ellipe ( ) )
let test_ellipeinc ( ) = Alcotest . ( check bool ) " test ellipeinc " true ( To_test . test_ellipeinc ( ) )
let test_gamma ( ) = Alcotest . ( check bool ) " test gamma " true ( To_test . test_gamma ( ) )
let test_rgamma ( ) = Alcotest . ( check bool ) " test rgamma " true ( To_test . test_rgamma ( ) )
let test_loggamma ( ) = Alcotest . ( check bool ) " test loggamma " true ( To_test . test_loggamma ( ) )
let test_gammainc ( ) = Alcotest . ( check bool ) " test gammainc " true ( To_test . test_gammainc ( ) )
let test_gammaincinv ( ) = Alcotest . ( check bool ) " test gammaincinv " true ( To_test . test_gammaincinv ( ) )
let test_gammaincc ( ) = Alcotest . ( check bool ) " test gammaincc " true ( To_test . test_gammaincc ( ) )
let test_gammainccinv ( ) = Alcotest . ( check bool ) " test gammainccinv " true ( To_test . test_gammainccinv ( ) )
let test_psi ( ) = Alcotest . ( check bool ) " test psi " true ( To_test . test_psi ( ) )
let test_beta ( ) = Alcotest . ( check bool ) " test beta " true ( To_test . test_beta ( ) )
let test_betainc ( ) = Alcotest . ( check bool ) " test betainc " true ( To_test . test_betainc ( ) )
let test_bdtr ( ) = Alcotest . ( check bool ) " test bdtr " true ( To_test . test_bdtr ( ) )
let test_bdtrc ( ) = Alcotest . ( check bool ) " test bdtrc " true ( To_test . test_bdtrc ( ) )
let test_bdtri ( ) = Alcotest . ( check bool ) " test bdtri " true ( To_test . test_bdtri ( ) )
let test_btdtr ( ) = Alcotest . ( check bool ) " test btdtr " true ( To_test . test_btdtr ( ) )
let test_btdtri ( ) = Alcotest . ( check bool ) " test btdtri " true ( To_test . test_btdtri ( ) )
let test_fact ( ) = Alcotest . ( check bool ) " test fact " true ( To_test . test_fact ( ) )
let test_log_fact ( ) = Alcotest . ( check bool ) " test log_fact " true ( To_test . test_log_fact ( ) )
let test_combination ( ) = Alcotest . ( check bool ) " test combination " true ( To_test . test_combination ( ) )
let test_mulmod ( ) = Alcotest . ( check bool ) " test mulmod " true ( To_test . test_mulmod ( ) )
let test_powmod ( ) = Alcotest . ( check bool ) " test powmod " true ( To_test . test_powmod ( ) )
let test_is_prime ( ) = Alcotest . ( check bool ) " test is_prime " true ( To_test . test_is_prime ( ) )
let test_set = [ " test j0 " , ` Slow , test_j0 ; " test j1 " , ` Slow , test_j1 ; " test jv " , ` Slow , test_jv ; " test y0 " , ` Slow , test_y0 ; " test y1 " , ` Slow , test_y1 ; " test yv " , ` Slow , test_yv ; " test i0 " , ` Slow ,...
module type T = M . T
module type T = sig end
module type T = sig ; ; end
module type T = functor ( M : T ) -> functor ( M1 : T1 ) -> sig end
sig end and module M = M ' . MF ( X ) and type t ' = t ' '
module type T = ( sig end )
module type T = sig val v : t external x : ' a = " stub " type t = int and t2 = t exception Error of int class virtual [ ' a ] cl : object end and cl2 : object end class type clt = object end and [ ' a ] clt2 = object end module M : Sig module M ( X ) ( Y ) : Sig module type Sig mo...
module Make ( N : Ndarray_Algodiff with type elt = float ) = struct let tolerance_f64 = 1e - 8 let tolerance_f32 = 5e - 4 let close a b = N . ( sub a b |> abs |> sum ' ) < tolerance_f32 let test_sum_reduce ( ? seq = false ) ( ? a = true ) expected shape axis = let input = if seq...
let x0 = Arr . sequential [ | 10 ] |
let x1 = Arr . sequential [ | 10 ; 10 ] |
let x2 = Arr . sequential [ | 10 ; 10 ; 10 ] |
module To_test = struct let test_01 ( ) = let b = ref 0 . in Arr . iter ( fun a -> b := ! b . + a ) x0 ; let c = Arr . sum ' x0 in ! b = c let test_02 ( ) = let b = ref 0 . in Arr . iter ( fun a -> b := ! b . + a ) x1 ; let c = Arr . sum ' x1 in ! b = c let t...
let test_01 ( ) = Alcotest . ( check bool ) " test 01 " true ( To_test . test_01 ( ) )
let test_02 ( ) = Alcotest . ( check bool ) " test 02 " true ( To_test . test_02 ( ) )
let test_03 ( ) = Alcotest . ( check bool ) " test 03 " true ( To_test . test_03 ( ) )
let test_04 ( ) = Alcotest . ( check bool ) " test 04 " true ( To_test . test_04 ( ) )
let test_05 ( ) = Alcotest . ( check bool ) " test 05 " true ( To_test . test_05 ( ) )
let test_06 ( ) = Alcotest . ( check bool ) " test 06 " true ( To_test . test_06 ( ) )
let test_07 ( ) = Alcotest . ( check bool ) " test 07 " true ( To_test . test_07 ( ) )
let test_08 ( ) = Alcotest . ( check bool ) " test 08 " true ( To_test . test_08 ( ) )
let test_09 ( ) = Alcotest . ( check bool ) " test 09 " true ( To_test . test_09 ( ) )
let test_10 ( ) = Alcotest . ( check bool ) " test 10 " true ( To_test . test_10 ( ) )
let test_11 ( ) = Alcotest . ( check bool ) " test 11 " true ( To_test . test_11 ( ) )
let test_12 ( ) = Alcotest . ( check bool ) " test 12 " true ( To_test . test_12 ( ) )
let test_13 ( ) = Alcotest . ( check bool ) " test 13 " true ( To_test . test_13 ( ) )
let test_14 ( ) = Alcotest . ( check bool ) " test 14 " true ( To_test . test_14 ( ) )
let test_15 ( ) = Alcotest . ( check bool ) " test 15 " true ( To_test . test_15 ( ) )
let test_16 ( ) = Alcotest . ( check bool ) " test 16 " true ( To_test . test_16 ( ) )
let test_17 ( ) = Alcotest . ( check bool ) " test 17 " true ( To_test . test_17 ( ) )
let test_18 ( ) = Alcotest . ( check bool ) " test 18 " true ( To_test . test_18 ( ) )
let test_19 ( ) = Alcotest . ( check bool ) " test 19 " true ( To_test . test_19 ( ) )
let test_20 ( ) = Alcotest . ( check bool ) " test 20 " true ( To_test . test_20 ( ) )
let test_21 ( ) = Alcotest . ( check bool ) " test 21 " true ( To_test . test_21 ( ) )
let test_22 ( ) = Alcotest . ( check bool ) " test 22 " true ( To_test . test_22 ( ) )
let test_23 ( ) = Alcotest . ( check bool ) " test 23 " true ( To_test . test_23 ( ) )
let test_24 ( ) = Alcotest . ( check bool ) " test 24 " true ( To_test . test_24 ( ) )
let test_25 ( ) = Alcotest . ( check bool ) " test 25 " true ( To_test . test_25 ( ) )
let test_set = [ " test 01 " , ` Slow , test_01 ; " test 02 " , ` Slow , test_02 ; " test 03 " , ` Slow , test_03 ; " test 04 " , ` Slow , test_04 ; " test 05 " , ` Slow , test_05 ; " test 06 " , ` Slow , test_06 ; " test 07 " , ` ...
module Make ( N : Ndarray_Algodiff with type elt = float ) = struct let tolerance_f64 = 1e - 8 let tolerance_f32 = 5e - 4 let close a b = N . ( sub a b |> abs |> sum ' ) < tolerance_f32 let test_maxpool2d input_shape kernel stride pad = let inp = N . sequential ~ a : 1 . input_shape ...
module Make ( N : Ndarray_Algodiff with type elt = float ) = struct let tolerance_f64 = 1e - 8 let tolerance_f32 = 5e - 4 let close a b = N . ( sub a b |> abs |> sum ' ) < tolerance_f32 let test_maxpool3d input_shape kernel stride pad = let inp = N . sequential ~ a : 1 . input_shape ...
let ndarray = Alcotest . testable ( fun _p ( _x : ( float , float64_elt ) M . t ) -> ( ) ) M . equal
let blackman_reference = M . zeros Float64 [ | 4 ] |
let hamming_reference = M . zeros Float64 [ | 4 ] |
let hann_reference = M . zeros Float64 [ | 4 ] |
let _ = M . set blackman_reference [ | 0 ] | 0 . ; M . set blackman_reference [ | 1 ] | 0 . 63 ; M . set blackman_reference [ | 2 ] | 0 . 63 ; M . set blackman_reference [ | 3 ] | 0 . ; M . set hamming_reference [ | 0 ] | 0 . 08 ; M . set hamm...
module To_test = struct let blackman ( ) = let b = blackman 4 in let max_err = ( Arr . map2 ( fun x y -> x . - y ) blackman_reference b |> Arr . abs |> Arr . max |> Arr . get ) [ | 0 ] | in max_err < 1e - 5 let hamming ( ) = let h = hamming 4 in let max_err = ( Arr ....
let blackman ( ) = Alcotest . ( check bool ) " blackman " true ( To_test . blackman ( ) )
let hamming ( ) = Alcotest . ( check bool ) " hamming " true ( To_test . hamming ( ) )
let hann ( ) = Alcotest . ( check bool ) " hann " true ( To_test . hann ( ) )
let freqz ( ) = Alcotest . ( check bool ) " freqz " true ( To_test . freqz ( ) )
let test_set = [ " blackman " , ` Slow , blackman ; " hamming " , ` Slow , hamming ; " hann " , ` Slow , hann ; " freqz " , ` Slow , freqz ]
module Make ( N : Ndarray_Compare with type elt = float ) = struct let x0 = N . sequential [ | 10 ] | let x1 = N . sequential [ | 10 ; 10 ] | let x2 = N . sequential [ | 10 ; 10 ; 10 ] | let x3 = N . sequential [ | 5 ; 5 ; 5 ; 5 ] | module To_test = stru...
let x0 = Arr . sequential [ | 10 ] |
let x1 = Arr . sequential [ | 10 ; 10 ] |
let x2 = Arr . sequential [ | 10 ; 10 ; 10 ] |
let x3 = Arr . sequential [ | 5 ; 5 ; 5 ; 5 ] |
module To_test = struct let test_01 ( ) = let s = [ R [ ] ] in let y = Arr . get_fancy s x0 in Arr . ( y = x0 ) let test_02 ( ) = let s = [ L [ 1 ] ] in let y = Arr . get_fancy s x0 in let z = Arr . of_array [ | 1 . ] | [ | 1 ] | in Arr . ( y = z ) le...
let test_01 ( ) = Alcotest . ( check bool ) " test 01 " true ( To_test . test_01 ( ) )
let test_02 ( ) = Alcotest . ( check bool ) " test 02 " true ( To_test . test_02 ( ) )
let test_03 ( ) = Alcotest . ( check bool ) " test 03 " true ( To_test . test_03 ( ) )
let test_04 ( ) = Alcotest . ( check bool ) " test 04 " true ( To_test . test_04 ( ) )
let test_05 ( ) = Alcotest . ( check bool ) " test 05 " true ( To_test . test_05 ( ) )
let test_06 ( ) = Alcotest . ( check bool ) " test 06 " true ( To_test . test_06 ( ) )