microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

Should we generalize buildFromSparse? #802

Open awf opened 3 years ago

awf commented 3 years ago

If this were allowed:

buildFromSparse  4 (\ i. 2*i, constVec(i, 1.1 * i))

It would make this object

[[]
 ?
 [1.1]
 ?
 [2.2 2.2]
 ?
 ?
 ?
 [3.3 3.3 3.3]
]

Do we want to?

awf commented 3 years ago

Today we would write

buildFromSparse  (build 8 (\i . i)) 4 (\ i. 2*i, constVec(i, 1.1 * i))

which probably makes more sense.