Skip to content

Commit 98eb262

Browse files
committed
Fix a bug when reinit tensor, we didn't do so with stride.
1 parent ce93a48 commit 98eb262

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/nnc/ccv_nnc_symbolic_graph_compile.c

+3
Original file line numberDiff line numberDiff line change
@@ -4266,7 +4266,10 @@ int ccv_nnc_tensor_arena_reinit(ccv_nnc_tensor_arena_t* const tensor_arena, cons
42664266
const int alias_ref = tensor_arena->vt_alias_refs[i] - 1;
42674267
ccv_nnc_tensor_data(tensor->info, tensor_arena->vt_tensors[alias_ref]->data.u8, off + tensor_arena->vt_tensors[alias_ref]->dataof, &tensor->data, &tensor->dataof);
42684268
if (CCV_IS_TENSOR_VIEW(tensor))
4269+
{
42694270
((ccv_nnc_tensor_view_t*)tensor)->off = off;
4271+
memcpy(((ccv_nnc_tensor_view_t*)tensor)->stride, symbol_info->stride, sizeof(((ccv_nnc_tensor_view_t*)tensor)->stride));
4272+
}
42704273
}
42714274
}
42724275
// Should handle sub_tensor_arena, don't do that at the moment.

0 commit comments

Comments
 (0)