sbrunk/storch

Complete tensor ops

Opened this issue · 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.

*
* @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.