A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://arrayfire.github.io/arrayfire-rust/arrayfire/../arrayfire/../arrayfire/fn.print_gen.html below:

arrayfire::print_gen - Rust

[−][src]Function arrayfire::print_gen
pub fn print_gen<T: HasAfEnum>(
    msg: String,
    input: &Array<T>,
    precision: Option<i32>
)

Generalized Array print function

Use this function to print Array data with arbitrary preicsion

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4