New proposal for handling tensor views
This is a new proposal for handling views in Tensor.
Compared to !13 (closed), this proposal does not change the interface of TensorImpl
and does not require low level Extract()
implementation. It also adds missing essential facilities, such as isContiguous()
, makeContiguous()
and refContiguous()
.
What is in this MR?
-
mImpl
is nowshared_ptr
instead ofunique_ptr
, with removed dependence toTensor
inTensorImpl
; - Added
mImplOffset
parameter for data offset of the current Tensor w.r.t. shared implementation; - Added
mStrides
parameter to Tensor; - Tensor copy-ctor and assignment operators now make a shallow copy (when possible). Added a
clone()
function for deep copy; - Added 2
extract()
functions for extracting a sub-tensor; - Added a
makeContiguous()
function to make memory contiguous (andrefContiguous()
on the same model asrefCastFrom()
). -
resize()
behavior currently is to throw if one tries to change de size with a shared implementation.- Alternative behavior(?): make a new implementation during resize and stop sharing previous implementation.
Edited by Olivier BICHLER
Merge request reports
Activity
Filter activity
assigned to @olivierbichler
added 20 commits
-
3a88f9be...63c7fe12 - 19 commits from branch
main
- 5f918671 - Merge branch 'main' into view
-
3a88f9be...63c7fe12 - 19 commits from branch
changed milestone to %aidge_core - v0.2.0
added 12 commits
-
5f918671...9f7c89aa - 9 commits from branch
dev
- a5fb8430 - Add CHANGELOG
- 657c7302 - Added Tensor::ref() methods
- 9157399f - Merged with main
Toggle commit list-
5f918671...9f7c89aa - 9 commits from branch
added 1 commit
- deea0be0 - makeContiguous optimization (single copy for contiguous chuncks of memory)
mentioned in merge request !73 (merged)
changed milestone to %aidge_core - v0.2.0
mentioned in commit 1bd36647
Please register or sign in to reply