-
Why Is there any variant that would make a new tensor that is a slice of an existing tensor but without copying the original tensor (e.g.: a method that accepts |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
How would I properly split into train and test tensors? |
Beta Was this translation helpful? Give feedback.
-
If you still want to use the tensor after the slice, simply do |
Beta Was this translation helpful? Give feedback.
If you still want to use the tensor after the slice, simply do
tensor.clone().slice(...)
. Cloning does not copy the data it just increases a reference count. And then you can proceed to usetensor
in following operations.