interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / pytorch / kernels / relu.om

12 lines · 306 bytes Raw Blame History
1note relu: o = x where x is not below 0.0, else 0.0 (aten.relu); NaN is kept, as aten.relu keeps it.
2note The caller supplies the const line L (the element count) before this text.
3fn relu x view f32 L o edit f32 L to void
4for i ulong L
5v = get x i
6if lt v 0.0f32
7put o i 0.0f32
8else
9put o i v
10end
11end
12end