-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interface file for Values library
- Loading branch information
1 parent
2b8f445
commit 7c67d9c
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(* Values Interface *) | ||
|
||
open Bigarray | ||
|
||
(* Type Definitions *) | ||
type standard_array = float array array | ||
type values = (float, float32_elt, c_layout) Array2.t | ||
type dimensions = int * int | ||
|
||
(* Creating *) | ||
val from_array : standard_array -> values | ||
val create : dimensions -> float -> values | ||
val ones : dimensions -> values | ||
val zeros : dimensions -> values | ||
val random : dimensions -> values | ||
|
||
(* Utilities *) | ||
val dim : values -> int * int | ||
val print : values -> unit | ||
|
||
|
||
(* Unary Operations *) | ||
val log : values -> values | ||
val exp : values -> values | ||
val sqrt : values -> values | ||
val reciprocal: values -> values | ||
val abs : values -> values | ||
val pow2 : values -> values | ||
val sum : values -> values | ||
val neg : values -> values | ||
|
||
(* Binary Operations *) | ||
val dot : values -> values -> values | ||
val div : values -> values -> values | ||
val mul : values -> values -> values | ||
val add : values -> values -> values | ||
val sub : values -> values -> values | ||
val matmul : ?trans_a:int -> ?trans_b:int -> values -> values -> values |