Skip to content

Unstablity of Tensor.data() #1732

Closed Locked Answered by mikowals
Rick0827 asked this question in Q&A
Discussion options

You must be logged in to vote

sample owns the pointer and is destroyed after its last use. So free() is called on the pointer before you read from it. You can either keep the tensor from being destroyed by using it after you read the pointer or you can take ownership of the pointer with sample._steal_ptr().

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Rick0827
Comment options

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