imalsogreg commented on a change in pull request #6563:
URL: https://github.com/apache/incubator-tvm/pull/6563#discussion_r497180923



##########
File path: rust/tvm-rt/src/ndarray.rs
##########
@@ -184,28 +246,19 @@ impl NDArray {
     /// let ctx = Context::cpu(0);
     /// let mut ndarray = NDArray::empty(&mut shape, ctx, 
DataType::from_str("int32").unwrap());
     /// ndarray.copy_from_buffer(&mut data);
-    /// assert_eq!(ndarray.shape(), Some(&mut shape[..]));
+    /// assert_eq!(ndarray.shape(), shape);
     /// assert_eq!(ndarray.to_vec::<i32>().unwrap(), data);
     /// ```
     pub fn to_vec<T>(&self) -> Result<Vec<T>, NDArrayError> {

Review comment:
       I'm confused about how this function works. If I call it as 
`my_array.to_vec<u8>`, I'll get back a vector with more elements than if I call 
it as `my_array.to_vec::<u32>`, which seems like one or the other would not 
correspond to a flattened version of `self`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to