text
stringlengths
12
786k
let fun_ctb10 ( ) = Alcotest . ( check bool ) " fun_ctb10 " true ( To_test_transpose_conv2d_backward . fun10 ( ) )
let fun_ctb11 ( ) = Alcotest . ( check bool ) " fun_ctb11 " true ( To_test_transpose_conv2d_backward . fun11 ( ) )
let fun_ctb12 ( ) = Alcotest . ( check bool ) " fun_ctb12 " true ( To_test_transpose_conv2d_backward . fun12 ( ) )
let fun_ctb13 ( ) = Alcotest . ( check bool ) " fun_ctb13 " true ( To_test_transpose_conv2d_backward . fun13 ( ) )
let fun_ctb14 ( ) = Alcotest . ( check bool ) " fun_ctb14 " true ( To_test_transpose_conv2d_backward . fun14 ( ) )
let fun_ctb15 ( ) = Alcotest . ( check bool ) " fun_ctb15 " true ( To_test_transpose_conv2d_backward . fun15 ( ) )
let test_set = [ " fun_ctf00 " , ` Slow , fun_ctf00 ; " fun_ctf01 " , ` Slow , fun_ctf01 ; " fun_ctf02 " , ` Slow , fun_ctf02 ; " fun_ctf03 " , ` Slow , fun_ctf03 ; " fun_ctf04 " , ` Slow , fun_ctf04 ; " fun_ctf05 " , ` Slow , fun_ctf05 ; " fu...
let close a b = N . ( sub a b |> abs |> sum ' ) < tolerance_f32
let compute_trans_conv3d seq input_shape kernel_shape stride pad = let inp = N . ones input_shape in let kernel = if seq = false then N . ones kernel_shape else N . sequential ~ a : 1 . kernel_shape in N . transpose_conv3d ~ padding : pad inp kernel stride
let compute_trans_conv3d_bi seq input_shape kernel_shape stride pad = let inp = N . ones input_shape in let kernel = if seq = false then N . ones kernel_shape else N . sequential ~ a : 1 . kernel_shape in let output = N . transpose_conv3d ~ padding : pad inp kernel stride in let os = N . shape ou...
let compute_trans_conv3d_bk seq input_shape kernel_shape stride pad = let inp = N . ones input_shape in let kernel = N . ones kernel_shape in let output = N . transpose_conv3d ~ padding : pad inp kernel stride in let os = N . shape output in let output ' = if seq = false then N . ones os else N . ...
let verify_value ( ? seq = false ) fn input_shape kernel_shape stride pad expected = let a = fn seq input_shape kernel_shape stride pad in let output_shape = N . shape a in let b = N . of_array expected output_shape in close a b
module To_test_transpose_conv3d = struct let fun00 ( ) = let expected = [ | 1 . 0 ; 2 . 0 ; 3 . 0 ; 2 . 0 ; 1 . 0 ; 2 . 0 ; 4 . 0 ; 6 . 0 ; 4 . 0 ; 2 . 0 ; 3 . 0 ; 6 . 0 ; 9 . 0 ; 6 . 0 ; 3 . 0 ; 2 . 0 ; 4 . 0 ...
module To_test_transpose_conv3d_backward = struct let fun00 ( ) = let expected = [ | 9 . ; 9 . ; 9 . ; 9 . ] | in verify_value compute_trans_conv3d_bi [ | 1 ; 2 ; 2 ; 1 ; 1 ] | [ | 3 ; 3 ; 1 ; 1 ; 1 ] | [ | 2 ; 2 ; 1 ] | VALID expected le...
let fun_ctf00 ( ) = Alcotest . ( check bool ) " fun_ctf00 " true ( To_test_transpose_conv3d . fun00 ( ) )
let fun_ctf01 ( ) = Alcotest . ( check bool ) " fun_ctf01 " true ( To_test_transpose_conv3d . fun01 ( ) )
let fun_ctf02 ( ) = Alcotest . ( check bool ) " fun_ctf02 " true ( To_test_transpose_conv3d . fun02 ( ) )
let fun_ctf03 ( ) = Alcotest . ( check bool ) " fun_ctf03 " true ( To_test_transpose_conv3d . fun03 ( ) )
let fun_ctf04 ( ) = Alcotest . ( check bool ) " fun_ctf04 " true ( To_test_transpose_conv3d . fun04 ( ) )
let fun_ctb00 ( ) = Alcotest . ( check bool ) " fun_ctb00 " true ( To_test_transpose_conv3d_backward . fun00 ( ) )
let fun_ctb01 ( ) = Alcotest . ( check bool ) " fun_ctb01 " true ( To_test_transpose_conv3d_backward . fun01 ( ) )
let fun_ctb02 ( ) = Alcotest . ( check bool ) " fun_ctb02 " true ( To_test_transpose_conv3d_backward . fun02 ( ) )
let fun_ctb03 ( ) = Alcotest . ( check bool ) " fun_ctb03 " true ( To_test_transpose_conv3d_backward . fun03 ( ) )
let fun_ctb04 ( ) = Alcotest . ( check bool ) " fun_ctb04 " true ( To_test_transpose_conv3d_backward . fun04 ( ) )
let fun_ctb05 ( ) = Alcotest . ( check bool ) " fun_ctb05 " true ( To_test_transpose_conv3d_backward . fun05 ( ) )
let fun_ctb06 ( ) = Alcotest . ( check bool ) " fun_ctb06 " true ( To_test_transpose_conv3d_backward . fun06 ( ) )
let fun_ctb07 ( ) = Alcotest . ( check bool ) " fun_ctb07 " true ( To_test_transpose_conv3d_backward . fun07 ( ) )
let fun_ctb08 ( ) = Alcotest . ( check bool ) " fun_ctb08 " true ( To_test_transpose_conv3d_backward . fun08 ( ) )
let fun_ctb09 ( ) = Alcotest . ( check bool ) " fun_ctb09 " true ( To_test_transpose_conv3d_backward . fun09 ( ) )
let fun_ctb10 ( ) = Alcotest . ( check bool ) " fun_ctb10 " true ( To_test_transpose_conv3d_backward . fun10 ( ) )
let fun_ctb11 ( ) = Alcotest . ( check bool ) " fun_ctb11 " true ( To_test_transpose_conv3d_backward . fun11 ( ) )
let fun_ctb12 ( ) = Alcotest . ( check bool ) " fun_ctb12 " true ( To_test_transpose_conv3d_backward . fun12 ( ) )
let fun_ctb13 ( ) = Alcotest . ( check bool ) " fun_ctb13 " true ( To_test_transpose_conv3d_backward . fun13 ( ) )
let fun_ctb14 ( ) = Alcotest . ( check bool ) " fun_ctb14 " true ( To_test_transpose_conv3d_backward . fun14 ( ) )
let fun_ctb15 ( ) = Alcotest . ( check bool ) " fun_ctb15 " true ( To_test_transpose_conv3d_backward . fun15 ( ) )
let test_set = [ " fun_ctf00 " , ` Slow , fun_ctf00 ; " fun_ctf01 " , ` Slow , fun_ctf01 ; " fun_ctf02 " , ` Slow , fun_ctf02 ; " fun_ctf03 " , ` Slow , fun_ctf03 ; " fun_ctf04 " , ` Slow , fun_ctf04 ; " fun_ctb00 " , ` Slow , fun_ctb00 ; " fu...
type t type ' a t type ' + _a t type ' - a t type ( ' a , ' + b , ( ' - c , ' - d ) ) t
type t = A | B of ' a | C of ' a * ' b | D of ( ' a ) Array . t * ' b list | E of _
type t = { f1 : t1 ; f2 : ' a ; mutable f3 : t2 ; f4 : ' a ' b . t2 ; }
type ' a t constraint ' a = t constraint ' b = ' a type ( ' a , ' + b , ( ' - c , ' - d ) ) t = { f1 : t1 ; f2 : ' a ; mutable f3 : t2 ; f4 : t1 * t2 ; } constraint ' a = t constraint ' b = ' a exception E exception E of ' a t * string exception E ' =...
' ident _ ( t ) int -> int -> t -> t -> t lab1 : int -> lab2 : ( t ) -> t ? lab1 : ( ? _ : int -> t ) -> t ( t1 * t2 ) * ( t ) int ( ' a -> ' b ) Array . t int as ' bla [ ` _ | ` _ ' | ` _00 | ` Aa of int ] | ` _ | ` _ ' | ` _00 | `...
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_upsampling2d_forward input_shape size = let inp = N . sequential input_shape in let outp = N ...
module V = Owl_view . Make ( N )
let x0 = N . sequential [ | 10 ] | |> V . of_arr
let x1 = N . sequential [ | 10 ; 10 ] | |> V . of_arr
let x2 = N . sequential [ | 10 ; 10 ; 10 ] | |> V . of_arr
let x3 = N . sequential [ | 5 ; 5 ; 5 ; 5 ] | |> V . of_arr
module To_test = struct let test_01 ( ) = let s = [ [ ] ] in let y = V . get_slice s x0 in V . equal y x0 let test_02 ( ) = let s = [ [ 3 ] ] in let y = V . get_slice s x0 in let z = N . of_array [ | 3 . ] | [ | 1 ] | in V . equal y ( V . of_arr z ) 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_26 ( ) = Alcotest . ( check bool ) " test 26 " true ( To_test . test_26 ( ) )
let test_27 ( ) = Alcotest . ( check bool ) " test 27 " true ( To_test . test_27 ( ) )
let test_28 ( ) = Alcotest . ( check bool ) " test 28 " true ( To_test . test_28 ( ) )
let test_29 ( ) = Alcotest . ( check bool ) " test 29 " true ( To_test . test_29 ( ) )
let test_30 ( ) = Alcotest . ( check bool ) " test 30 " true ( To_test . test_30 ( ) )
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 " , ` ...
let clientlst = ref [ ]
type ( ' a , ' b ) t = State of ' a | Bundle of ' a * ( iworld_t * ' b ) list * iworld_t list
let rec sendmail lst1 = match lst1 with [ ] -> ( ) | ( first1 , first2 ) :: rest -> begin if List . mem_assoc first1 ! clientlst then Socket . send ( Some first2 ) first1 ; sendmail rest end
let initial_new state iworld = State state
let initial_msg state iworld sexp = State state
let initial_tick state = State state
let initial_disconnect state iworld = Bundle ( state , [ ] , [ iworld ] )
let universe ( ? on_new = initial_new ) ( ? on_msg = initial_msg ) ( ? rate = 1 . 0 ) ( ? on_tick = initial_tick ) ( ? on_disconnect = initial_disconnect ) initial_state = let rate = int_of_float ( 1000 . . * rate ) in let state = ref initial_state in let server_sockfd = ...
module Key = struct module Witness = struct type ' a t = . . end module type T = sig type t type ' a Witness . t += T : t Witness . t val id : int val name : string val to_dyn : t -> Dyn . t end type ' a t = ( module T with type t = ' a ) let next = ref 0 let create ( type a ) ~...
module Binding = struct type t = T : ' a Key . t * ' a -> t end
type t = Binding . t Int . Map . t
let set ( type a ) t ( key : a Key . t ) x = let ( module M ) = key in let data = Binding . T ( key , x ) in Int . Map . set t M . id data
let add ( type a ) t ( key : a Key . t ) ( x : a ) : ( t , a ) Result . t = let ( module M ) = key in let data = Binding . T ( key , x ) in match Int . Map . add t M . id data with | Ok x -> Ok x | Error ( Binding . T ( key ' , x ) ) -> let eq = Key . e...
let update ( type a ) t ( key : a Key . t ) ~ f = let ( module M ) = key in Int . Map . update t M . id ~ f ( : function | None -> f None |> Option . map ~ f ( : fun x -> Binding . T ( key , x ) ) | Some ( Binding . T ( key ' , x ) ) -> let eq = Key . e...
let mem t key = Int . Map . mem t ( Key . id key )
let remove t key = Int . Map . remove t ( Key . id key )
let find t key = match Int . Map . find t ( Key . id key ) with | None -> None | Some ( Binding . T ( key ' , v ) ) -> let eq = Key . eq key ' key in Some ( Type_eq . cast eq v )
let find_exn t key = match Int . Map . find t ( Key . id key ) with | None -> failwith " Univ_map . find_exn " | Some ( Binding . T ( key ' , v ) ) -> let eq = Key . eq key ' key in Type_eq . cast eq v
let singleton key v = Int . Map . singleton ( Key . id key ) ( Binding . T ( key , v ) )
let to_dyn ( t : t ) = let open Dyn . Encoder in Dyn . Map ( Int . Map . values t |> List . map ~ f ( : fun ( Binding . T ( key , v ) ) -> let ( module K ) = key in ( string K . name , K . to_dyn v ) ) )
module type S = sig type t module Key : sig type ' a t val create : name : string -> ( ' a -> Dyn . t ) -> ' a t end val empty : t val is_empty : t -> bool val mem : t -> ' a Key . t -> bool val set : t -> ' a Key . t -> ' a -> t val add : t -> ' a Key . t -> ' a -> ( ...