-
Notifications
You must be signed in to change notification settings - Fork 49
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
Improve documentation for stream
argument to __dlpack__
#185
Conversation
Closes data-apisgh-183 The need to document the ownership of `stream` came up in pytorch/pytorch#57781.
@@ -434,7 +434,13 @@ Exports the array for consumption by {ref}`function-from_dlpack` as a DLPack cap | |||
|
|||
- **stream**: _Optional\[ int ]_ |
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.
- **stream**: _Optional\[ int ]_ | |
- **stream**: _Any_ |
You could also go for Optional[Union[int, Any]]
or Union[int, None, Any]
, but in the end all these statements are equivalent.
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.
Thanks Bas, I missed updating that. From a typing point of view they're indeed all the same. From a "this serves as documentation as well" point of view, I think I prefer Optional[Union[int, Any]]
.
I agree. By moving the new additions to a separate page (say the current "Data interchange mechanisms"), we can just add a new |
Makes sense. Let me do that in a separate PR, and address some of the other points in the PR description as well once we've figured out how to communicate version information. |
I propose to merge this as is; the bigger update and content moving will take a little while. |
Thanks for the reviews everyone! |
__dlpack__
should not be required to be integers #183 (SYCL needs a queue not an integer).stream
came up in Addtorch.cuda.streams.ExternalStream
pytorch/pytorch#57781.This is getting pretty long for reference documentation of a method, we may need to split it out to a separate page soon. Especially given that there may be more to add soon:
PushStreamDep
in Specify synchronization semantics dmlc/dlpack#57 (comment))For now this is the minimal update for things that are being discussed.
Cc @oleksandr-pavlyk, @tqchen, @leofang