~/bend-docscommunity

cells.bend checks

raw source on the hub · import bend-ndarray@0.1.0.0/cells.bend as Cells

bend-ndarray's element functions: one cell (32 bits) at a time, by operation and dtype. float32 cells hold their IEEE bits; int32 two's complement; uint32 and uint8 their value (uint8 below 256); bool 0 or 1. Integer arithmetic wraps around (uint8 modulo 256), as NumPy's does.

2 imports
import Base
import ./shape.bend as S

Types

type B2 source · line 38 · raw

Data

type U1 source · line 301 · raw

Data

Definitions

def fb source · line 7 · raw

@x:U32 -> F32

def bf source · line 12 · raw

@x:F32 -> U32

def b2u source · line 17 · raw

@b:Bool -> U32

def neg source · line 20 · raw

@+x:U32 -> U32

def is_neg source · line 23 · raw

@+x:U32 -> Bool

def u8 source · line 26 · raw

@+x:U32 -> U32

def slt source · line 30 · raw

@+x:U32 -> @+y:U32 -> Bool

signed order on int32 bits

def fnan source · line 33 · raw

@+x:U32 -> Bool

def op_name source · line 58 · raw

@op:B2 -> String

def is_f32 source · line 97 · raw

@dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> Bool

def is_bool source · line 104 · raw

@dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> Bool

def supports source · line 113 · raw

@op:B2 -> @+dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> Bool

which dtypes an operation takes: arithmetic on numbers (true division and power on float32 only), comparisons on every dtype, logic on bool

def is_cmp source · line 140 · raw

@op:B2 -> Bool

def is_i32 source · line 157 · raw

@dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> Bool

def is_u8 source · line 164 · raw

@dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> Bool

def beq source · line 171 · raw

@a:Bool -> @b:Bool -> Bool

def f_rem_fix source · line 183 · raw

@+r:F32 -> @+y:F32 -> F32

fmod's remainder (the dividend's sign) to Python's (the divisor's)

def f2 source · line 186 · raw

@op:B2 -> @+x:U32 -> @+y:U32 -> U32

def i_div_go source · line 224 · raw

@+q:U32 -> @+r:U32 -> @diff:Bool -> U32

int32 floor division and remainder (Python's // and %; 0 for a zero divisor, as NumPy)

def abs32 source · line 231 · raw

@+x:U32 -> U32

def i_fdiv source · line 234 · raw

@+x:U32 -> @+y:U32 -> U32

def i_rem source · line 238 · raw

@+x:U32 -> @+y:U32 -> U32

def u_fdiv source · line 241 · raw

@+x:U32 -> @+y:U32 -> U32

def u_rem source · line 244 · raw

@+x:U32 -> @+y:U32 -> U32

def i2 source · line 248 · raw

@op:B2 -> @+signed:Bool -> @+m:U32 -> @+x:U32 -> @+y:U32 -> U32

int32 (signed) and uint32 / uint8 / bool (unsigned); m is the mask for the result (255 for uint8)

def cell2 source · line 286 · raw

@+op:B2 -> @dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+x:U32 -> @+y:U32 -> U32

one cell of a binary operation

def i32_to_f32 source · line 308 · raw

@+x:U32 -> F32

def f32_to_i32 source · line 312 · raw

@+f:F32 -> U32

float32 to int32 bits, toward zero

def conv_from_f32 source · line 315 · raw

@to:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+x:U32 -> U32

def conv_int source · line 328 · raw

@+signed:Bool -> @to:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+x:U32 -> U32

def conv source · line 339 · raw

@from:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+to:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+x:U32 -> U32

def cell1 source · line 348 · raw

@op:U1 -> @+dt:0x3812e108d3d3723b9d582970dd383a5c/shape.DType -> @+x:U32 -> U32