pub fn print_gen<T: HasAfEnum>(
msg: String,
input: &Array<T>,
precision: Option<i32>,
)Expand description
Generalized Array print function
Use this function to print Array data with arbitrary preicsion
§Parameters
msgis message to be printed before printing the Array datainputis the Array to be printedprecisionis data precision with which Array has to be printed
§Examples
use arrayfire::{Dim4, print_gen, randu};
println!("Create a 5-by-3 matrix of random floats on the GPU");
let dims = Dim4::new(&[5, 3, 1, 1]);
let a = randu::<f32>(dims);
print_gen(String::from("Random Array"), &a, Some(6));The sample output will look like below:
Random Array
[5 3 1 1]
0.740276 0.446440 0.776202
0.921094 0.667321 0.294810
0.039014 0.109939 0.714090
0.969058 0.470269 0.358590
0.925181 0.513225 0.681451