MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / main

Function main

examples/using_half.rs:4–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use half::f16;
3
4fn main() {
5 set_device(0);
6 info();
7
8 let values: Vec<_> = (1u8..101).map(std::convert::From::from).collect();
9
10 let half_values = values.iter().map(|&x| f16::from_f32(x)).collect::<Vec<_>>();
11
12 let hvals = Array::new(&half_values, Dim4::new(&[10, 10, 1, 1]));
13
14 print(&hvals);
15}

Callers

nothing calls this directly

Calls 3

set_deviceFunction · 0.85
infoFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected