Skip to content

Use const_data_ptr/mutable_data_ptr instead of deprecated data_ptr#20958

Open
cyyever wants to merge 2 commits into
pytorch:mainfrom
cyyever:use-const-data-ptr
Open

Use const_data_ptr/mutable_data_ptr instead of deprecated data_ptr#20958
cyyever wants to merge 2 commits into
pytorch:mainfrom
cyyever:use-const-data-ptr

Conversation

@cyyever

@cyyever cyyever commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

ExecuTorch Tensor::data_ptr is ET_DEPRECATED. Replace remaining call sites: read-only accesses use const_data_ptr, the rest use mutable_data_ptr (sampler input, CMSIS-NN struct fields, JNI/mmap'd buffers that require non-const pointers).

Left unchanged: backends/aoti/slim (SlimTensor has no const/mutable variants) and at::Tensor::data_ptr() in extension/pybindings (not deprecated; for_blob takes void*).

Authored with Claude Code.

@pytorch-bot

pytorch-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20958

Note: Links to docs will display an error until the docs builds have been completed.

❌ 6 New Failures, 1 Unrelated Failure

As of commit fb9f428 with merge base e16c048 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@rascani

rascani commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Thanks @cyyever! This LGTM, just one cleanup on cuda_mutable_state.cpp

Comment thread backends/cuda/runtime/cuda_mutable_state.cpp Outdated
@cyyever cyyever force-pushed the use-const-data-ptr branch from cbda78d to fb9f428 Compare July 16, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants