Type system basics
Chelis keeps tensor dimensions and precision explicit.
Primitive ideas
Section titled “Primitive ideas”- No implicit precision promotion
- No implicit broadcasting
- Named tensor dimensions must match by name
- Integer literals default to
int32, float literals tof32
Tensor type fragments
Section titled “Tensor type fragments”(t-tensor {} (d-name {} batch) (d-name {} seq) (t-prim {} f32))tensor[batch, seq, f32]A small typed program
Section titled “A small typed program”def add_vec(x: tensor[n, f32], y: tensor[n, f32]) -> tensor[n, f32] = add(x, y)Reading the Deep shape
Section titled “Reading the Deep shape”(defsig {} add_vec (t-fn {} (t-tensor {} (d-name {} n) (t-prim {} f32)) (t-tensor {} (d-name {} n) (t-prim {} f32)) (t-tensor {} (d-name {} n) (t-prim {} f32))))