def ew_d2

bendtorch-fast@1.3.0.0 · main.bend:29

import bendtorch-fast@1.3.0.0/main.bend as BendtorchFast
import Base
import bend-ml-tensor-fork@0.1.5.0/main.bend as TF

29# log2 of the blocks for cnt numbers: one block below 131072 (MNIST's and the tiny Llama's matrices; at 100352 the
30# blocks cost MNIST more than they gave on 16 threads), else one per 16384, at most 64
31def ew_d2(small: Bool, big: Bool, +cnt: Nat) -> Nat:
32  match small big:
33    case True{} _:
34      0n
35    case False{} True{}:
36      6n
37    case False{} False{}:
38      TF.depth(Nat.div(cnt, 16384n))

Uses (4)

Used by (1)