- 
  Notifications
 You must be signed in to change notification settings 
- Fork 58
-
To convert arrayfire array in C++ from f64 to i32, we could simply use as(i32). What is the equivalent method in rust version?
// Example, double precision array
af::array A_double(100, 1, f64); // f64 = double precision
// Cast to an i32 array
af::array A_single = A_double.as(i32);
Beta Was this translation helpful? Give feedback.
All reactions
 
 
 Answered by
 
 3togo
 
 
 
 Aug 31, 2022 
 
 
 I guess it should be
A_double.cast::();
Replies: 1 comment 1 reply
-
I guess it should be
A_double.cast::();
Beta Was this translation helpful? Give feedback.
All reactions
 
 1 reply
 
 
 -
Docs - https://arrayfire.org/arrayfire-rust/arrayfire/struct.Array.html#method.cast 
Example usage - https://github.com/arrayfire/arrayfire-rust/blob/master/examples/conway.rs#L27 
Beta Was this translation helpful? Give feedback.
All reactions
- 
 👍 1
 Answer selected by
 3togo
 
 Sign up for free
 to join this conversation on GitHub.
 Already have an account?
 Sign in to comment