harvardnlp / namedtensor

Named Tensor implementation for Torch
http://nlp.seas.harvard.edu/NamedTensor
MIT License
441 stars 42 forks source link

Possible fix NTorch.index_copy_ #89

Closed JKinx closed 5 years ago

JKinx commented 5 years ago

Changed the signatures of NamedTensorBase._broadcast_order and NamedTensorBase.._mask_broadcast_order to take in names and not NamedTensors.

This is needed since NTorch.index_copy_ needs to know the dimension names and size of self[index]. Getting them using NTorch._index_base might be more efficient than getting the actual tensor itself.