Closed JeremieMelo closed 1 year ago
Do you have a usecase where you need the indices to be on GPU?
Typically, given the size of the indices, the overhead of converting is negligible, but if you have need for supporting torch tensors there we can add that.
Fixed in #24
When I use FactorizedEmbedding, I found that it does not support CUDA Tensor as input indices. Because in
BlockTT.__getitem__()
, it usesnp.unravel_index(index)
, which cannot take CUDA Tensor as input... Since PyTorch does not haveunravel_index()
yet, either moving CUDA indices to CPU or writing a Torch Version ofunravel_index()
will fix this bug.