Check the contiguous of DLTensor when wrapping it to Array#30
Check the contiguous of DLTensor when wrapping it to Array#30songjhaha wants to merge 2 commits intop-zubieta:mainfrom
Conversation
|
Sorry for the delay here. I'm a bit hesitant about to handle this, I would ideally want to return views with something like |
|
@pabloferz, thanks for the discussion, I'm considering some similar question these days. But I think wrapping a subarray could be a bit difficult here if we only have the information from the dltensor. Because we need to firstly wrap the parent array of the subarray, then compute the indices which could return the correct subarray. Also, in some cases this problem could be complex. For example, dltensor is some transposed ndarray, like transposing a 3D tensor with permutation (2, 1, 3). I'm not sure subarray could handle this situation.😔 |
As described in #29
An array is not
col_majordoesn't means it'srow_major, it could be non-contiguous, so throw an error here if the contiguous check didn't pass. (maybe we could copy the data with the information of strides, and wrap a new Array, but not a efficient way)