Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/src/mojollama/mojo_engine/test_here.mojo # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / src / mojollama / mojo_engine / test_here.mojo` 14 lines ยท 427 bytes Raw Blame History 1 from std import time 2 3 def test_fn(out: Span[Float32, _], w: Span[UInt8, _], n: Int): 4 for i in range(n): out[i] = Float32(w[i]) 5 6 def main(): 7 var a = alloc[Float32](4) 8 var b = alloc[UInt8](4) 9 for i in range(4): b.store(i, UInt8(i * 3)) 10 var sa = Span[Float32, _](ptr=a, length=4) 11 var sb = Span[UInt8, _](ptr=b, length=4) 12 test_fn(sa, sb, 4) 13 for i in range(4): print(i, sa[i]) 14 a.free(); b.free()