small fix reshape return
This commit is contained in:
parent
a45b930075
commit
8449575e70
4 changed files with 6 additions and 6 deletions
|
|
@ -127,6 +127,7 @@ void zeros_like_tensor_cpu(Tensor* tensor, float* result_data) {
|
|||
}
|
||||
}*/
|
||||
|
||||
|
||||
void transpose_tensor_cpu(Tensor* tensor, float* result_data) {
|
||||
int* shape = tensor->shape;
|
||||
int ndim = tensor->ndim;
|
||||
|
|
@ -146,7 +147,6 @@ void transpose_tensor_cpu(Tensor* tensor, float* result_data) {
|
|||
}
|
||||
result_data[idx_result] = tensor->data[idx_source];
|
||||
|
||||
// Update indices
|
||||
indices[ndim - 1]++;
|
||||
for (int dim = ndim - 1; dim > 0; dim--) {
|
||||
if (indices[dim] == shape[dim]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue