--
You received this message because you are subscribed to the Google Groups "Rust for TensorFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/e003118d-3626-4a75-af0f-e66b0ae98984%40tensorflow.org.
Hey Kahlil,I am no expert but I think that the issue is due to the shape of the slice that is output from "getFakeImgArray"When I've used the Rust Tensorflow API, I passed a flattened version of the array to the Tensor "with_values" function and created the expected value-filled Tensor.In order to best explain, I've made a small Github repo that has an example of creating and populating a Tensor in Rust, and then a comparable Numpy array in Python. The README has a better description: https://github.com/drbh/rs-tf-tensorsHope this helps! Good luck
On Sun, Jan 12, 2020 at 1:24 PM Kahlil Abreu <kahli...@holmusk.com> wrote:
--I have the following code. I have tried a lot to try and modify the created Tensor, but it gives me the error (pasted below)What strikes me as odd is that it is able to create the Tensor and (default behaviour) initialize all the values of the Tensor to 0, but if I want to modify the Tensor (OR Create a Tensor with some values other than 0), it does not allow me to do that.```fn getFakeImgArray () -> [[[ [f32;1]; 32]; 32];1] {...}let mut fakeImgTensor = Tensor::new(&[1,32,32,1]);fakeImgTensor = fakeImgTensor.with_values(&[getFakeImgArray()]).unwrap();```Error message :```error[E0277]: the trait bound `[[[[f32; 1]; 32]; 32]; 1]: tensorflow::TensorType` is not satisfied
--> src/main.rs:173:47
|
173 | fakeImgTensor = fakeImgTensor.with_values(&[getFakeImgArray()]).unwrap();
| ^^^^^^^^^^^^^^^^^^^^ the trait `tensorflow::TensorType` is not implemented for `[[[[f32; 1]; 32]; 32]; 1]`
|
= note: required by `tensorflow::Tensor::<T>::new````
You received this message because you are subscribed to the Google Groups "Rust for TensorFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ru...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/e003118d-3626-4a75-af0f-e66b0ae98984%40tensorflow.org.
--David Holtz