hanzo-ml 0.10.2

Minimalist ML framework.
Documentation
1
2
3
4
5
6
7
8
9
10
#version 450
// to_dtype F32 -> U32: out[i] = uint(in[i])  (truncates toward zero, like Rust `as`).
layout(local_size_x = 64) in;
layout(set = 0, binding = 0) readonly  buffer In  { float inp[]; };
layout(set = 0, binding = 1) writeonly buffer Out { uint o[]; };
layout(push_constant) uniform Pc { uint n; };
void main() {
    uint i = gl_GlobalInvocationID.x;
    if (i < n) { o[i] = uint(max(inp[i], 0.0)); }
}