clone
- Tensor.clone(auto_copy: bool = True)
Allocates memory for a new current
Tensorobject that is a copy of the currentTensorobject ifauto_copyis true.- Parameters:
auto_copy (bool, default) --
Determines if the data stored in the buffer is copied to the new
Tensorobject.If set to
true(default), a new buffer is allocated, and both the data stored in the buffer and its associated metadata (such as size and memory type) are copied to the new buffer.If set to
false, a new buffer is allocated, and only the metadata (such as size and memory type) is copied to the new buffer, but its memory is uninitialized and does not contain the original data.