Skip to content

Commit

Permalink
[tensorflow-sys] use product instead of fold
Browse files Browse the repository at this point in the history
  • Loading branch information
dskkato committed Nov 11, 2021
1 parent 8e9b2a5 commit aa9f6cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow-sys/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn linkage() {
fn tfe_tensor_handle() {
let data = vec![0.0f32; 100];
let shape = [1, 10, 10];
let num_elements = shape.iter().fold(1, |t, x| t * x) as usize;
let num_elements = shape.iter().product::<i64>() as usize;

unsafe {
let tf_tensor = ffi::TF_AllocateTensor(
Expand Down

0 comments on commit aa9f6cc

Please sign in to comment.