storch icon indicating copy to clipboard operation
storch copied to clipboard

Complete tensor ops

Open sbrunk opened this issue 1 year ago • 0 comments

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.

https://github.com/sbrunk/storch/blob/2ea690ff698caa82884b0b72a6aa511565300b20/core/src/main/scala/torch/Tensor.scala#L428-L432

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 avatar Mar 09 '23 07:03 sbrunk