text
stringlengths 12
786k
|
---|
let fun_cdbi06 ( ) = Alcotest . ( check bool ) " fun_cdbi06 " true ( To_test_dilated_conv3d_bi . fun06 ( ) ) |
let fun_cdbk00 ( ) = Alcotest . ( check bool ) " fun_cdbk00 " true ( To_test_dilated_conv3d_bk . fun00 ( ) ) |
let fun_cdbk01 ( ) = Alcotest . ( check bool ) " fun_cdbk01 " true ( To_test_dilated_conv3d_bk . fun01 ( ) ) |
let fun_cdbk02 ( ) = Alcotest . ( check bool ) " fun_cdbk02 " true ( To_test_dilated_conv3d_bk . fun02 ( ) ) |
let fun_cdbk03 ( ) = Alcotest . ( check bool ) " fun_cdbk03 " true ( To_test_dilated_conv3d_bk . fun03 ( ) ) |
let fun_cdbk04 ( ) = Alcotest . ( check bool ) " fun_cdbk04 " true ( To_test_dilated_conv3d_bk . fun04 ( ) ) |
let fun_cdbk05 ( ) = Alcotest . ( check bool ) " fun_cdbk05 " true ( To_test_dilated_conv3d_bk . fun05 ( ) ) |
let fun_cdbk06 ( ) = Alcotest . ( check bool ) " fun_cdbk06 " true ( To_test_dilated_conv3d_bk . fun06 ( ) ) |
let test_set = [ " fun_cdf00 " , ` Slow , fun_cdf00 ; " fun_cdf01 " , ` Slow , fun_cdf01 ; " fun_cdf02 " , ` Slow , fun_cdf02 ; " fun_cdf03 " , ` Slow , fun_cdf03 ; " fun_cdf04 " , ` Slow , fun_cdf04 ; " fun_cdf05 " , ` Slow , fun_cdf05 ; " fun_cdf06 " , ` Slow , fun_cdf06 ; " fun_cdbi00 " , ` Slow , fun_cdbi00 ; " fun_cdbi01 " , ` Slow , fun_cdbi01 ; " fun_cdbi02 " , ` Slow , fun_cdbi02 ; " fun_cdbi03 " , ` Slow , fun_cdbi03 ; " fun_cdbi04 " , ` Slow , fun_cdbi04 ; " fun_cdbi05 " , ` Slow , fun_cdbi05 ; " fun_cdbi06 " , ` Slow , fun_cdbi06 ; " fun_cdbk00 " , ` Slow , fun_cdbk00 ; " fun_cdbk01 " , ` Slow , fun_cdbk01 ; " fun_cdbk02 " , ` Slow , fun_cdbk02 ; " fun_cdbk03 " , ` Slow , fun_cdbk03 ; " fun_cdbk04 " , ` Slow , fun_cdbk04 ; " fun_cdbk05 " , ` Slow , fun_cdbk05 ; " fun_cdbk06 " , ` Slow , fun_cdbk06 ] |
let e = begin true end |
let e = ( true : bool ) |
let e = true , false , true |
let e = Some true |
let e = ` _ true |
let e = true :: false :: true |
let e = [ true ; false ; true ; ] |
let e = [ | true ; false ; true ] | |
let e = { f1 = true ; f2 = false ; f3 = true ; } |
let e = { e with f1 = true ; f2 = false ; } |
let e = f true false true |
let e = !? true |
let e = true || false && true |
let e = 1 mod 1 land 1 lor 1 lxor 1 lsl 1 lsr 1 asr 1 |
let e = re . f1 <- true |
let e = a . ( 0 ) <- true |
let e = a . [ 0 ] <- true |
let e = if true then false else true |
let e = while true do ( ) done |
let e = for x = a to b do ( ) done |
let e = true ; false ; true |
let e = match true with | true -> false | false -> true |
let e = match true with | true -> false | false -> true |
let e = function | true -> false | false -> true |
let e = fun x ~ lbl1 ~ ( lbl2 : int ) ~ lbl3 : _a ? olbl1 ? ( olbl2 : ' a list = [ ] ) ? olbl3 : _c ? olbl4 : ( _d : bool = false ) ( ) when true -> true |
let e = fun x -> fun ~ lbl1 -> fun ~ ( lbl2 : int ) -> fun ~ lbl3 : _a -> fun ? olbl1 -> fun ? ( olbl2 : ' a list = [ ] ) -> fun ? olbl3 : _c when true -> fun ? olbl4 : ( _d : bool = false ) -> fun ( ) when true -> true |
let e x ~ lbl1 ~ ( lbl2 : int ) ~ lbl3 : _a ? olbl1 ? ( olbl2 : ' a list = [ ] ) ? olbl3 : _c ? olbl4 : ( _d : bool = false ) ( ) = true |
let e = try true with | Exit -> true | _ -> false |
let e = let rec a = true and _b = false in true |
let e = new foo |
let foo = object end |
let e = foo # bar1 |
let e = ( true :> bool ) |
let e = ( true : bool :> bool ) |
let e = assert true |
let e = lazy true |
let i = 12l + 0l |
let i = 12L + 0l |
let i = 12n + 0n |
let f = function | ' a ' . . ' z ' -> e1 | ' A ' . . ' Z ' | ' 0 ' . . ' 9 ' -> e2 |
let f = let module M = F ( struct end ) in M . f x |
module rec M : S = struct ; ; end struct ; ; end |
type t = private X of string | Y |
type t = private { f1 : t1 ; f2 : t2 } |
type t = private t ' |
let _ = let open F ( X ) in ( ) |
let _ = let x = 1 and y = 2 in { x ; y } |
let f = function | { x ; y ; _ } -> ( ) |
let f = fun ( type t ) ( x : t ) -> ( ) |
let f ( type t ) ( x : t ) = ( ) |
type m = ( module M . Sig with type t = ' b ) * unit |
let x = let m = ( module M : M . Sig with type t = ' b ) in let module M = ( val m : M . sig with type t = ' b ) in M |
module type S = sig include module type of M end |
module type S = sig include M0 with type t := t val x : unit end inherit ! cl val ! v = v method ! m = m end |
type _ t = A : int t | B : ' a t * ' b t -> ( ' a ' * b ) t |
let g f = f ( ) |
let _ = g 3 ; ; [ %% expect { | ^ unit -> ' a Hint : Did you forget to wrap the expression using ` fun ( ) ' ->? } ] ; ; | |
let _ = print_int 3 ; print_newline ; print_int 5 ; ; [ %% expect { | ^^^^^^^^^^^^^ but an expression was expected of type unit because it is in the left - hand side of a sequence Hint : Did you forget to provide ` ( ) ' as argument ? } ] ; ; | |
let x = read_int in [ %% expect { | ^ but an expression was expected of type int Hint : Did you forget to provide ` ( ) ' as argument ? } ] ; ; | |
let g f = let _ = f ( ) in f = 3 ; ; [ %% expect { | ^ unit -> ' a Hint : Did you forget to wrap the expression using ` fun ( ) ' ->? } ] ; ; | |
let g f = let _ = f ( ) in 3 = f ; ; [ %% expect { | ^ but an expression was expected of type int Hint : Did you forget to provide ` ( ) ' as argument ? } ] | |
let to_array order traversal nodes = let s = Owl_utils . Stack . make ( ) in let f u = Owl_utils . Stack . push s u in M . iter_descendants ~ order ~ traversal f nodes ; Array . map M . attr ( Owl_utils . Stack . to_array s ) |
let graph ( ) = let n0 , n1 , n2 , n3 , n4 = M . node 0 , M . node 1 , M . node 2 , M . node 3 , M . node 4 in M . connect [ | n0 ] | [ | n1 ; n2 ; n3 ] ; | M . connect [ | n1 ] | [ | n2 ] ; | M . connect [ | n2 ; n3 ] | [ | n4 ] ; | n0 , n1 , n2 , n3 , n4 |
module To_test = struct let topo0 ( ) = let _ , _ , _ , _ , n4 = graph ( ) in Array . map M . attr ( M . topo_sort [ | n4 ] ) | = [ | 0 ; 1 ; 2 ; 3 ; 4 ] | let topo1 ( ) = let _ , _ , n2 , n3 , _ = graph ( ) in Array . map M . attr ( M . topo_sort [ | n2 ; n3 ] ) | = [ | 0 ; 1 ; 2 ; 3 ] | let dfs0 ( ) = let n0 , n1 , n2 = M . node 0 , M . node 1 , M . node 2 in M . connect [ | n0 ] | [ | n1 ] ; | M . connect [ | n1 ] | [ | n2 ] ; | M . connect [ | n2 ] | [ | n0 ] ; | to_array DFS PostOrder [ | n0 ] | = [ | 2 ; 1 ; 0 ] | let dfs1 ( ) = let n0 = M . node 0 in to_array DFS PreOrder [ | n0 ] | = [ | 0 ] | let bfs0 ( ) = let n0 , n1 , n2 , n3 , n4 = M . node 0 , M . node 1 , M . node 2 , M . node 3 , M . node 4 in M . connect [ | n0 ] | [ | n1 ; n3 ] ; | M . connect [ | n1 ] | [ | n2 ; n3 ] ; | M . connect [ | n2 ] | [ | n3 ] ; | M . connect [ | n2 ; n3 ] | [ | n4 ] ; | to_array BFS PreOrder [ | n0 ] | = [ | 0 ; 1 ; 3 ; 2 ; 4 ] | let num0 ( ) = let _ , _ , n2 , _ , _ = graph ( ) in M . num_ancestor [ | n2 ] | = 3 && M . num_descendant [ | n2 ] | = 2 end |
let topo0 ( ) = Alcotest . ( check bool ) " topo0 " true ( To_test . topo0 ( ) ) |
let topo1 ( ) = Alcotest . ( check bool ) " topo1 " true ( To_test . topo1 ( ) ) |
let dfs0 ( ) = Alcotest . ( check bool ) " dfs0 " true ( To_test . dfs0 ( ) ) |
let dfs1 ( ) = Alcotest . ( check bool ) " dfs1 " true ( To_test . dfs1 ( ) ) |
let bfs0 ( ) = Alcotest . ( check bool ) " bfs0 " true ( To_test . bfs0 ( ) ) |
let num0 ( ) = Alcotest . ( check bool ) " num0 " true ( To_test . num0 ( ) ) |
let test_set = [ " topo0 " , ` Slow , topo0 ; " topo1 " , ` Slow , topo1 ; " dfs0 " , ` Slow , dfs0 ; " dfs1 " , ` Slow , dfs1 ; " bfs0 " , ` Slow , bfs0 ; " num0 " , ` Slow , num0 ] |
module M = Owl . Lazy . Make ( Owl_algodiff_primal_ops . D ) |
let tol = 20 . 0 . * epsilon_float |
let cmp a b = Arr . ( l1norm ' ( a - b ) ) < tol |
let x0 = Arr . zeros [ | 3 ; 4 ] | |
let x1 = Arr . ones [ | 3 ; 4 ] | |
let x2 = Arr . sequential ~ a : 1 . [ | 3 ; 4 ] | |
let x3 = Arr . ( uniform [ | 3 ; 4 ] | - x1 ) |
let x4 = Arr . ( uniform [ | 4 ; 4 ] | -$ 1 . ) |
module To_test = struct let fun00 ( ) = let x = M . var_arr " " in let y = M . abs x in M . assign_arr x x3 ; M . eval_arr [ | y ] ; | let a = M . unpack_arr y in let b = Arr . abs x3 in cmp a b let fun01 ( ) = let x = M . var_arr " " in let y = x |> M . sin |> M . cos in M . assign_arr x x3 ; M . eval_arr [ | y ] ; | let a = M . unpack_arr y in let b = x3 |> Arr . sin |> Arr . cos in cmp a b let fun02 ( ) = let x = M . var_arr " " in let y = x |> M . neg |> M . cosh |> M . tanh in M . assign_arr x x3 ; M . eval_arr [ | y ] ; | let a = M . unpack_arr y in let b = x3 |> Arr . cosh |> Arr . tanh in cmp a b let fun03 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . add x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . add x2 x3 in cmp a b let fun04 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . sub x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . sub x2 x3 in cmp a b let fun05 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . mul x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . mul x2 x3 in cmp a b let fun06 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . div x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . div x2 x3 in cmp a b let fun07 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . pow x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . pow x2 x3 in cmp a b let fun08 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . atan2 x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . atan2 x2 x3 in cmp a b let fun09 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . hypot x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . hypot x2 x3 in cmp a b let fun10 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . min2 x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . min2 x2 x3 in cmp a b let fun11 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . max2 x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . max2 x2 x3 in cmp a b let fun12 ( ) = let x = M . var_arr " " in let y = M . var_arr " " in let z = M . max2 x y in M . assign_arr x x2 ; M . assign_arr y x3 ; M . eval_arr [ | z ] ; | let a = M . unpack_arr z in let b = Arr . max2 x2 x3 in cmp a b let fun13 ( ) = let x = M . var_arr " " in let y = M . dot x x in M . assign_arr x x4 ; M . eval_arr [ | y ] ; | let a = M . unpack_arr y in let b = Arr . dot x4 x4 in cmp a b end |
let fun00 ( ) = Alcotest . ( check bool ) " fun00 " true ( To_test . fun00 ( ) ) |
let fun01 ( ) = Alcotest . ( check bool ) " fun01 " true ( To_test . fun01 ( ) ) |
let fun02 ( ) = Alcotest . ( check bool ) " fun02 " true ( To_test . fun02 ( ) ) |
let fun03 ( ) = Alcotest . ( check bool ) " fun03 " true ( To_test . fun03 ( ) ) |
let fun04 ( ) = Alcotest . ( check bool ) " fun04 " true ( To_test . fun04 ( ) ) |
let fun05 ( ) = Alcotest . ( check bool ) " fun05 " true ( To_test . fun05 ( ) ) |
let fun06 ( ) = Alcotest . ( check bool ) " fun06 " true ( To_test . fun06 ( ) ) |
let fun07 ( ) = Alcotest . ( check bool ) " fun07 " true ( To_test . fun07 ( ) ) |
let fun08 ( ) = Alcotest . ( check bool ) " fun08 " true ( To_test . fun08 ( ) ) |
let fun09 ( ) = Alcotest . ( check bool ) " fun09 " true ( To_test . fun09 ( ) ) |
let fun10 ( ) = Alcotest . ( check bool ) " fun10 " true ( To_test . fun10 ( ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.