File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 77 - We check FP16 constants for overflow.
88 - We output half precision specific code from the CUDA backend.
99- Finally proper support for mixed precision! Lazy precision defaults and delayed precision setting via ` Tnode.update_prec ` .
10+ - A placeholder ` nn_blocks.ml ` hinting at an intended design pattern for model components.
1011
1112### Changed
1213
Original file line number Diff line number Diff line change 1616 arrayjit)
1717 (preprocess
1818 (pps ppx_jane ppx_ocannl ppx_minidebug))
19- (modules PrintBox_utils row shape tensor operation train)
19+ (modules PrintBox_utils row shape tensor operation train nn_blocks )
2020 (modes byte native)
2121 (c_library_flags -pthread))
2222
Original file line number Diff line number Diff line change 1+ (* * Prior to OCANNL 0.5, this module is just a placeholder hinting at an intended design pattern
2+ for model components. *)
3+
4+ open ! Base
5+ module TDSL = Operation. TDSL
6+ module NTDSL = Operation. NTDSL
7+
8+ type mlp_layer_config = { label : string list ; hid_dim : int }
9+
10+ let % op mlp_layer ~config x = ?/ ((" w" * x) + " b" config.hid_dim)
11+
12+ type mlp_config = { label : string list ; hid_dims : int list }
13+
14+ let mlp ~config =
15+ let layers =
16+ List. mapi config.hid_dims ~f: (fun i hid_dim ->
17+ mlp_layer ~config: { label = [ " L" ^ Int. to_string i ]; hid_dim })
18+ in
19+ fun x -> List. fold layers ~init: x ~f: (fun x layer -> layer x)
You can’t perform that action at this time.
0 commit comments