lucidrains / rotary-embedding-torch

Implementation of Rotary Embeddings, from the Roformer paper, in Pytorch
MIT License
535 stars 43 forks source link

Is 'broadcat' part of the API? #17

Closed rsxdalv closed 9 months ago

rsxdalv commented 9 months ago

With the latest versions broadcat function is no longer available to import; however, projects like tortoise depend on this import. Should this import have been private, and not part of the public API?

lucidrains commented 9 months ago

@rsxdalv oh oops! no idea it was being used, and in such a high profile project!

in a later commit, i discovered broadcast_tensors and that function got reduced down to 3 loc

from torch import broadcast_tensors

def broadcat(tensors, dim = -1):
    broadcasted_tensors = broadcast_tensors(*tensors)
    return torch.cat(broadcasted_tensors, dim = dim)
rsxdalv commented 9 months ago

Actually I discovered that it's being imported but not being used; I didn't realize this at first as I'm a downstream project from tortoise.

Thank you for the quick response.

rsxdalv commented 9 months ago

So, in the scope of tortoise project, this issue can be closed.

lucidrains commented 9 months ago

@rsxdalv got it, yea, i brought it back just to save you the trouble

rsxdalv commented 9 months ago

Thank you, that will fix my project's installation!