Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete tensor ops #16

Open
sbrunk opened this issue Mar 9, 2023 · 0 comments
Open

Complete tensor ops #16

sbrunk opened this issue Mar 9, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@sbrunk
Copy link
Owner

sbrunk commented Mar 9, 2023

We should implement all ops available as methods on a tensor that make sense in Tensor.

Right now, quite a few are still missing, and even for the ones already ported, many still need docs.

Many of the calls are mostly wrappers of the native call and return a tensor of the same type, so they should be straightforward to add if you look at the existing ones, i.e. unsqueeze.

*
* @param dim
* the index at which to insert the singleton dimension
*/
def unsqueeze(dim: Int): Tensor[D] = Tensor(native.unsqueeze(dim))

Some need a bit more effort, i.e. if they return a different tensor type.

For Scaladoc it can be useful to look at the original PyTorch doc sources for these ops. Note that these docs are for the torch.unsqueeze(tensor, ...) but I think we should focus on the method defined on Tensor itself like myTensor.unsqueeze(...) first. We can still add the function variant later.

@sbrunk sbrunk added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 9, 2023
@sbrunk sbrunk added the enhancement New feature or request label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant