Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 46.23% 48.08% +1.85%
==========================================
Files 5 6 +1
Lines 186 183 -3
==========================================
+ Hits 86 88 +2
+ Misses 100 95 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
I see what you mean. Just from the name "one hot" I would have thought things like having multiple ones and a single row or column would be forbidden (here I am referring to the example at that link). But apparently this is the usage in ML, and also one element is just a much clearer name. |
They call that more general case a |
onehotisn't quite right for the ITensor constructor that creates a tensor with a single nonzero element, see OneHotArrays.jl.There is precedent from
FillArrays.jlandZygote.jlfor calling a sparse array with a single nonzero elementOneElement(https://github.com/JuliaArrays/FillArrays.jl), so here I am changingonehottooneelement.In the latest, this is implemented based on a new type
SparseArraysBase.OneElementArraywith an associated generic constructorSparseArraysBase.oneelementin a package extension, see ITensor/SparseArraysBase.jl#26.See also #5, ITensor/SparseArraysBase.jl#24.