Skip to content

Writable tensor? #46

Answered by brettc
qnzhou asked this question in Q&A
Jul 7, 2022 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

As @qnzhou said in #53, this looks like a limitation of using from_dlpack() and is by design. A related issue is the one mentioned in #42, where you cannot send a read-only numpy array to c++, though it looks like this might be worked around in nanobind.

So working through dlpack currently puts some constraints on passing tensors.

  1. You can't pass writeable tensors from c++ -> python.
  2. You can't pass read-only tensors from python -> c++.

I see that the reimplementation of the numpy interface is "open for discussion". @wjakob, is it worthwhile submitting a PR that ports the numpy code from pybind11? I could give this a go, though it might be a challenge given my limited understanding of the…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@wjakob
Comment options

@qnzhou
Comment options

@wjakob
Comment options

@qnzhou
Comment options

@wjakob
Comment options

Answer selected by wjakob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants