facebookresearch / diffkt

A framework for automatic differentiation in Kotlin
MIT License
60 stars 6 forks source link

Generalized index operation #5

Open gafter opened 3 years ago

gafter commented 3 years ago

Right now we have

This can be accomplished in diffkt as Z.gather(li, axis = 1).gather(lj, axis = 2) but at the expense of constructing a possibly large intermediate tensor.

It would be nice to have a generalized indexing operation in which each position could be any of

This would allow a direct translation of the idiomatic Python code, and possibly the avoidance of large intermediate tensors.