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
This commit is contained in:
Matthew Hoffman
2024-08-01 05:45:05 +00:00
committed by PyTorch MergeBot
parent 928adb7cc2
commit 7a779b5257
2 changed files with 44 additions and 0 deletions

View File

@ -476,6 +476,31 @@
"vecdot",
"vector_norm"
],
"torch.masked": [
"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"
],
"torch.multiprocessing": [
"Array",
"AuthenticationError",

View File

@ -31,8 +31,27 @@ 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",
]