Skip to content

Conversation

@cyx-6
Copy link
Contributor

@cyx-6 cyx-6 commented Sep 6, 2025

This PR added the ffi::Tensor.strides() method to get strides array of ffi::Tensor

if (obj->strides == nullptr) {
Shape strides = Shape(details::MakeStridesFromShape(obj->ndim, obj->shape));
obj->strides = const_cast<int64_t*>(strides.data());
obj->stride_data_ = std::move(strides);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you cannot return a moved strides, instead return strides_data_

@tqchen tqchen merged commit 58ab25e into apache:main Sep 7, 2025
13 checks passed
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
tqchen pushed a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants