Skip to content

Commit

Permalink
Add bool generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Oct 18, 2024
1 parent 1048932 commit 1ee9301
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/github.com/diku-dk/autodiff/onehot.fut
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ module type onehot = {
-- everywhere else.
val point 'a : (one: a) -> (zero: a) -> gen [1] a

val bool : gen [1] bool

val i8 : gen [1] i8
val i16 : gen [1] i16
val i32 : gen [1] i32
Expand Down Expand Up @@ -78,6 +80,7 @@ module onehot : onehot = {
def point one zero = {size = witness 1,
gen = \i -> if i == 0i64 then one else zero}

def bool = point true false
def i8 = point 1i8 0i8
def i16 = point 1i16 0i16
def i32 = point 1i32 0i32
Expand Down

0 comments on commit 1ee9301

Please sign in to comment.