Files
pytorch/torch/masked/__init__.py
Matthew Hoffman 7a779b5257 Add functions from torch.masked._ops to __all__ for torch.masked (#131288)
Add the non-private operations imported in this file to `__all__` so that pyright considers them to be publicly exported. Solves this error:

```
"mean" is not exported from module "torch.masked" Pylance[reportPrivateImportUsage]
```

Related: https://github.com/pytorch/pytorch/pulls?q=pyright+export

Pull Request resolved: https://github.com/pytorch/pytorch/pull/131288
Approved by: https://github.com/ezyang
2024-08-01 05:45:08 +00:00

58 lines
928 B
Python

from torch.masked._ops import (
_canonical_dim,
_combine_input_and_mask,
_generate_docstring,
_input_mask,
_output_mask,
_reduction_identity,
_where,
amax,
amin,
argmax,
argmin,
cumprod,
cumsum,
log_softmax,
logaddexp,
logsumexp,
mean,
median,
norm,
normalize,
prod,
softmax,
softmin,
std,
sum,
var,
)
from torch.masked.maskedtensor.core import is_masked_tensor, MaskedTensor
from torch.masked.maskedtensor.creation import as_masked_tensor, masked_tensor
__all__ = [
"amax",
"amin",
"argmax",
"argmin",
"as_masked_tensor",
"cumprod",
"cumsum",
"is_masked_tensor",
"log_softmax",
"logaddexp",
"logsumexp",
"masked_tensor",
"MaskedTensor",
"mean",
"median",
"norm",
"normalize",
"prod",
"softmax",
"softmin",
"std",
"sum",
"var",
]