-
Notifications
You must be signed in to change notification settings - Fork 241
refactor: privatize StridedLayout as _StridedLayout
#1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test d61ed66 |
This comment has been minimized.
This comment has been minimized.
|
|
||
| @classmethod | ||
| def from_buffer( | ||
| cls, buffer : Buffer, layout : _StridedLayout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to defer it to a follow up but having this constructor require a private class isn't ideal. Should we make this private as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will address these comments in the from_buffer PR follow-up.
| dlm_tensor = <DLManagedTensor*>data | ||
| dlm_tensor.deleter(dlm_tensor) | ||
|
|
||
| def view( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| raise NotImplementedError("Sorry, not supported: copy_to") | ||
|
|
||
| @property | ||
| def layout(self) -> _StridedLayout: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make this private for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in a follow-up.
d61ed66 to
855d5eb
Compare
|
/ok to test |
|
/ok to test |
|
Let me admin-merge this PR. All other CI pipelines are green but one, which seems to be causing the main branch to fail as well. I've raised a thread internally. |
|
Revert the revert of StridedLayout and privatize as
_StridedLayoutSummary
This PR reverts the removal of
StridedLayout(reverting #1370) andimmediately privatizes it to
_StridedLayoutto unblock ongoing work whileavoiding premature API stabilization.
Motivation
The original
StridedLayoutimplementation was reverted in #1370, but thisblocked work that depends on the internal layout infrastructure. Rather than
keeping the code removed, we've chosen to:
StridedLayoutfunctionalityStridedLayoutto_StridedLayout(making it internal-only)This approach allows internal and experimental code to continue using the
layout functionality while clearly signaling that the API is not yet stable.
Changes
StridedLayoutStridedLayoutto_StridedLayoutthroughout the codebase_StridedLayoutfrom public API documentationFollow-up Work
An immediate follow-up PR will refactor
StridedMemoryView.from_buffertoremove the
_StridedLayoutparameter and replace it with explicitstrideandshapearguments. This will further reduce the API surface of the internallayout implementation.