Print data in the Array # Parameters - `input` is the Array to be printed # Examples ```rust use arrayfire::{Dim4, print, 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:: (dims); print(&a); ``` The sample output will look like below: ```text [5 3 1 1] 0.7402 0.4464 0.7762 0.9210 0.6673 0.2948 0.03
(input: &Array<T>)
| 743 | /// 0.9251 0.5132 0.6814 |
| 744 | /// ``` |
| 745 | pub fn print<T: HasAfEnum>(input: &Array<T>) { |
| 746 | let emptystring = CString::new("").unwrap(); |
| 747 | unsafe { |
| 748 | let err_val = af_print_array_gen( |
| 749 | emptystring.to_bytes_with_nul().as_ptr() as *const c_char, |
| 750 | input.get(), |
| 751 | 4, |
| 752 | ); |
| 753 | HANDLE_ERROR(AfError::from(err_val)); |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | /// Generalized Array print function |
| 758 | /// |