This introduces a generic Empty{ElT, StoreT} storage type that is itself parametrized by a storage type StoreT. When an element of a Tensor with an Empty storage type is set, it returns a Tensor with a storage type StoreT. For example:
T = Tensor(Empty(), (2, 2)) # Empty() makes an Empty{Float64, Dense{Float64, ...}} storage
R = setindex!!(T, 2.3, 1, 1) # Returns a Dense Tensor R with all zeros except the 1,1 element
R[1, 1] == 2.3
R[1, 2] == 0.0
Additionally, a Tensor with an Empty storage type can be added to another Tensor, as a trivial additive identity (it returns a copy). This functionality has not been added yet.
This introduces a generic
Empty{ElT, StoreT}
storage type that is itself parametrized by a storage typeStoreT
. When an element of aTensor
with anEmpty
storage type is set, it returns aTensor
with a storage typeStoreT
. For example:Additionally, a
Tensor
with anEmpty
storage type can be added to anotherTensor
, as a trivial additive identity (it returns a copy). This functionality has not been added yet.