maskedtensor
maskedtensor copied to clipboard
MaskedTensors for PyTorch
### 🚀 The feature, motivation and pitch Sparse tensors already encode a masking patterns. It would be convenient to be able to consider a sparse matrix as a MaskedTensor where...
Considering the code below: ```python import torch import torch.optim as optim from maskedtensor import masked_tensor x = torch.Tensor([[ 0., 32., 23.], [18., 0., torch.nan], [54., 67., 0.]]) y = (x/2).nanmean(dim=0)...
### 🚀 The feature, motivation and pitch Many developers, like myself, use masks in both the prediction output and ground truth to evaluate whether or not an image, for example,...
### 🚀 The feature, motivation and pitch As seen in Issue #54, type promotion has not been implemented for masked reductions. We'd like to implement this to be consistent with...
As shown in the comments here: https://github.com/pytorch/maskedtensor/blob/a674e87cd4ee541e7a63c31b967c64d5bff433db/maskedtensor/unary.py#L79-L103 we have a number of unary operators that are not yet supported, possibly due to missing codegen or complex semantics. Opening this issue...
On initial commit, didn't include `nonzero` (instead returning boolean values for the mask, it returns a list of indices) as well as the backwards formulas