Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@YuchenJin
Copy link
Contributor

Adopt the new Python array API standard with DLPack:

  • Add __dlpack__(self, stream=None) and __dlpack_device__(self) methods on tvm.nd.NDArray. Note that tvm operates on the legacy default stream by default, so no explicit synchronization is needed.
  • tvm.nd.from_dlpack can take a tensor-like object with __dlpack__ method, or a DLPack capsule.

More contexts:

@YuchenJin
Copy link
Contributor Author

cc @tqchen @junrushao1994

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Thanks Yuchen for the contribution! Overall it looks good to me. Please fix the lint issues

@YuchenJin
Copy link
Contributor Author

YuchenJin commented May 6, 2021

Thanks, @junrushao1994! :)

@YuchenJin YuchenJin closed this May 6, 2021
@YuchenJin YuchenJin reopened this May 6, 2021
@junrushao junrushao merged commit 8d9a1df into apache:main May 7, 2021
@junrushao
Copy link
Member

Thanks @YuchenJin! It is now merged!

@YuchenJin YuchenJin deleted the support-new-dlpack-array-api branch May 7, 2021 22:27
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request May 19, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Jun 17, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jun 17, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
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