Skip to content

Commit e4ba512

Browse files
committed
add note about 1 vs 2-arg versions
1 parent 87748be commit e4ba512

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tensors/abstracttensor.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ This function determines the type of newly allocated `TensorMap`s throughout Ten
6363
It does so by leveraging type inference and calls to `Base.similar` for automatically determining
6464
appropriate storage types. Additionally this registers the default storage type when only a type
6565
`T <: Number` is provided, which is `Vector{T}`.
66+
67+
!!! note
68+
There is a slight semantic difference in the single and two-argument version. The former is
69+
used in constructor-like calls, and therefore will return the exact same type for a `DenseVector`
70+
input. The latter is used in `similar`-like calls, and therefore will return the type of calling
71+
`similar` on the given `DenseVector`, which need not coincide with the original type.
6672
""" similarstoragetype
6773

6874
# implement in type domain

0 commit comments

Comments
 (0)