Commit Graph

845 Commits

Author SHA1 Message Date
Nikita Karetnikov
aa8279bcb8 [primTorch] Improve narrow and narrow_copy: refs, tests, docs (#87045)
Fixes #87019.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/87045
Approved by: https://github.com/mruberry
2022-11-09 09:19:28 +00:00
Kazuaki Ishizaki
2ddefbdc3c Fix typos used in documents under torch directory (#88300)
This PR fixes typos, in comments of Python files, that are found from a search box at https://pytorch.org/docs/master/search.html

Pull Request resolved: https://github.com/pytorch/pytorch/pull/88300
Approved by: https://github.com/lezcano
2022-11-02 09:38:13 +00:00
foram-chandra
0f7df16c71 [doc] Add out-kwarg documentation to torch.where (#87870)
Fixes #87862

cc: @lezcano

Pull Request resolved: https://github.com/pytorch/pytorch/pull/87870
Approved by: https://github.com/lezcano
2022-10-27 21:03:42 +00:00
S.Cao-office
312628d299 Fixed minor typos in torch.flip and torch.rot90 (#87724)
Fixes #87721

@malfet

Pull Request resolved: https://github.com/pytorch/pytorch/pull/87724
Approved by: https://github.com/malfet
2022-10-25 19:51:42 +00:00
Edward Z. Yang
838b699e10 as_strided_scatter storage offset defaults to None not 0 (#87481)
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87481
Approved by: https://github.com/bdhirsh
2022-10-21 20:12:40 +00:00
Andrew M. James
db65909255 [Docs] Update mm family ops and F.linear to note limited sparse support. (#86220)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86220
Approved by: https://github.com/cpuhrsch
2022-10-18 19:55:18 +00:00
Nikita Vedeneev
f2ec9fbd03 torch.ormqr: backward support (#86800)
Seems good to have, especially when neither `a` nor `tau` requires grads and/or they are pretty small in number.
Fixes https://github.com/pytorch/pytorch/issues/86267

Pull Request resolved: https://github.com/pytorch/pytorch/pull/86800
Approved by: https://github.com/lezcano
2022-10-18 09:07:35 +00:00
Nikita Karetnikov
91b3cd0b5a [primTorch] Add a ref for narrow_copy (#86748)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86748
Approved by: https://github.com/mruberry
2022-10-17 10:16:05 +00:00
vfdev
3b26680222 Update _torch_docs / ldexp (#86721)
Fixes a typo on ldexp docstring.

https://pytorch.org/docs/master/generated/torch.ldexp.html?highlight=ldexp#torch.ldexp

<img width="976" alt="image" src="https://user-images.githubusercontent.com/2459423/195191117-15b4e1f3-dfd5-466c-b5aa-72851f0c2393.png">

https://livesphinx.herokuapp.com/
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86721
Approved by: https://github.com/samdow
2022-10-12 20:33:14 +00:00
Fabio Rocha
493ded249e [primTorch] decomposition for bucketize (#86366)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86366
Approved by: https://github.com/mruberry
2022-10-12 12:25:42 +00:00
vfdev
212fa874ce Fix torch histogramdd docstring (#86593)
Fixed torch histogramdd docsting with missing common_args

Pull Request resolved: https://github.com/pytorch/pytorch/pull/86593
Approved by: https://github.com/soulitzer
2022-10-11 17:52:18 +00:00
Jane Xu
f26292d91e [BE] Fix python docs typos up till torch.chunk (#86642)
Was doing the Views lab linked https://github.com/pytorch/pytorch/wiki/Tensor-and-Operator-Basics and noticed a few typos, which led to this PR.

Test plan:
verified in preview
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86642
Approved by: https://github.com/soulitzer
2022-10-11 17:42:53 +00:00
Yu Guo
b233d83471 make torch.histc ignore NaNs on CPU (#85870)
Summary: cuda torch.histc already ignores NaNs

Test Plan: unittest added

Differential Revision: D39911272

fix https://github.com/pytorch/pytorch/issues/85853

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85870
Approved by: https://github.com/ngimel
2022-10-06 01:09:00 +00:00
vfdev
103a21f480 Update _torch_docs.py (#85924)
Typo fix

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85924
Approved by: https://github.com/kit1980
2022-09-29 22:43:07 +00:00
Yu Guo
c036fb3e7d assert lambda >= 0 in poisson distribution cuda kernel (#85906)
fix https://github.com/pytorch/pytorch/issues/85731

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85906
Approved by: https://github.com/ngimel
2022-09-29 22:11:00 +00:00
PyTorch MergeBot
a0b1693996 Revert "Update amax/amin/norm/count_nonzero signatures with int[*]? dim (#83300)"
This reverts commit 1c0f0b33a0.

Reverted https://github.com/pytorch/pytorch/pull/83300 on behalf of https://github.com/jeffdaily due to The commit breaks nvfuser tests
2022-09-28 17:04:53 +00:00
Kurt Mohler
1c0f0b33a0 Update amax/amin/norm/count_nonzero signatures with int[*]? dim (#83300)
Changes `dim` arg to use `int[*]?` type for the following functions in `native_funcitons.yaml`:
* `amax`
* `amin`
* `norm`
* `frobenius_norm`
* `native_norm`
* `count_nonzero`

Part of #29137

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83300
Approved by: https://github.com/ngimel, https://github.com/albanD, https://github.com/kulinseth
2022-09-28 01:56:37 +00:00
PyTorch MergeBot
572dd862c4 Revert "Update amax/amin/norm/count_nonzero signatures with int[*]? dim (#83300)"
This reverts commit 8c7c7ed322.

Reverted https://github.com/pytorch/pytorch/pull/83300 on behalf of https://github.com/huydhn due to The commit pin breaks XLA test somehow
2022-09-28 01:36:43 +00:00
Jerry Zhang
9858f04350 [quant][docs] Add types for scale and zero_point tensor for torch.fake_quantize_per_channel_affine docs (#85733)
Summary:
Fixes: https://github.com/pytorch/pytorch/issues/85525

Test Plan:
visual inspection for the docs page

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85733
Approved by: https://github.com/z-a-f
2022-09-28 00:43:48 +00:00
Kurt Mohler
8c7c7ed322 Update amax/amin/norm/count_nonzero signatures with int[*]? dim (#83300)
Changes `dim` arg to use `int[*]?` type for the following functions in `native_funcitons.yaml`:
* `amax`
* `amin`
* `norm`
* `frobenius_norm`
* `native_norm`
* `count_nonzero`

Part of #29137

Pull Request resolved: https://github.com/pytorch/pytorch/pull/83300
Approved by: https://github.com/ngimel, https://github.com/albanD, https://github.com/kulinseth
2022-09-27 23:50:04 +00:00
wakananai
e1f9125e61 [doc] add argument default values in rot90 (#85610)
Add argument default values in rot90.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85610
Approved by: https://github.com/lezcano
2022-09-25 17:10:45 +00:00
foram-chandra
bd5efbb7ee [doc] add pin_memory argument to rand (#85221)
Similar to #85123

cc - @mruberry @kshitij12345
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85221
Approved by: https://github.com/mruberry
2022-09-25 10:47:59 +00:00
Ivan Yashchuk
539076e2c2 Remove deprecated torch.lstsq (#70980)
The time has come to remove deprecated linear algebra related functions. This PR removes `torch.lstsq`.

There's a note in `tools/codegen/gen.py` about `lstsq` schema in `native_function.yaml` that I will not remove:
87139d8532/tools/codegen/gen.py (L734-L770)

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70980
Approved by: https://github.com/lezcano, https://github.com/kit1980
2022-09-23 00:16:55 +00:00
Ivan Yashchuk
bcf93181a0 Remove deprecated torch.matrix_rank (#70981)
The time has come to remove deprecated linear algebra related functions. This PR removes `torch.matrix_rank`.

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70981
Approved by: https://github.com/lezcano, https://github.com/kit1980
2022-09-22 17:40:46 +00:00
foram-chandra
6fb182c86b [doc] document pin_memory for randn (#85219)
Fixes #85123

cc: @mruberry @kshitij12345

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85219
Approved by: https://github.com/mruberry
2022-09-21 22:43:52 +00:00
foram-chandra
3a09a1e8f0 [doc] remove out argument from squeeze (#85222)
Fixes #83972

cc- @ngimel @kshitij12345
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85222
Approved by: https://github.com/ezyang
2022-09-21 19:31:56 +00:00
lezcano
2a88f1b2d8 Land "Make ceil,floor,round,trunc handle integers" (#85144)
PR to land https://github.com/pytorch/pytorch/pull/78480, as Rohit does
not work in the PyTorch project anymore
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85144
Approved by: https://github.com/ngimel, https://github.com/mruberry
2022-09-21 17:23:47 +00:00
PyTorch MergeBot
7234eb06f7 Revert "Land "Make ceil,floor,round,trunc handle integers" (#85144)"
This reverts commit b27eb8d377.

Reverted https://github.com/pytorch/pytorch/pull/85144 on behalf of https://github.com/clee2000 due to broke slow tests in trunk  ex https://ossci-raw-job-status.s3.amazonaws.com/log/8433956087
2022-09-19 18:46:35 +00:00
lezcano
b27eb8d377 Land "Make ceil,floor,round,trunc handle integers" (#85144)
PR to land https://github.com/pytorch/pytorch/pull/78480, as Rohit does
not work in the PyTorch project anymore
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85144
Approved by: https://github.com/ngimel, https://github.com/mruberry
2022-09-19 17:21:48 +00:00
Sean Ross-Ross
3a51b557ef Added docs and opinfo for narrow_copy (#84493)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84493
Approved by: https://github.com/amjames, https://github.com/ngimel, https://github.com/mruberry
2022-09-19 14:28:25 +00:00
Kshiteej K
735154354b update torch.narrow doc (#85180)
Fixes #84783

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85180
Approved by: https://github.com/kit1980
2022-09-16 21:44:23 +00:00
Khushi Agrawal
2386cd2945 [reland] [numpy] add torch.concatenate, alias of torch.cat (#85073)
Previous PR: #82946

Fixes #81161

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85073
Approved by: https://github.com/mruberry
2022-09-15 19:34:44 +00:00
PyTorch MergeBot
fa7bf3e2dc Revert "[numpy] add torch.concatenate, alias of torch.cat (#82946)"
This reverts commit 270e5e519d.

Reverted https://github.com/pytorch/pytorch/pull/82946 on behalf of https://github.com/malfet due to Broke M1 tests, see 270e5e519d
2022-09-14 21:32:11 +00:00
Khushi Agrawal
270e5e519d [numpy] add torch.concatenate, alias of torch.cat (#82946)
As per the title. Fixes: #81161

- [x] add ErrorInputs
- ~[ ] dtype argument?~
- ~[ ] casting argument?~

As discussed offline with @kshitij12345, we can currently ignore `dtype` and `casting` arguments.

cc: @kshitij12345!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82946
Approved by: https://github.com/mruberry
2022-09-14 19:28:43 +00:00
Ivan Yashchuk
01c54ad6de Remove deprecated torch.eig (#70982)
The time has come to remove deprecated linear algebra related functions. This PR removes `torch.eig`.

cc @jianyuh @nikitaved @pearu @mruberry @walterddr @IvanYashchuk @xwang233 @Lezcano
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70982
Approved by: https://github.com/Lezcano, https://github.com/malfet
2022-09-09 21:31:57 +00:00
Andrew M. James
9b115c7bd3 Sparse Compressed Transpose add support for Batch dims and BSR/BSC layouts (#82122)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82122
Approved by: https://github.com/bhosmer
2022-09-02 17:42:58 +00:00
joncrall
b136f3f310 More doctest refinements. (#83317)
Follow up to #82797

Now that the doctests themselves are in a better state, we should be able to enable xdoctest on the CI so they stay that way.

@ezyang @vadimkantorov
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83317
Approved by: https://github.com/ezyang
2022-08-22 20:07:26 +00:00
PyTorch MergeBot
f534b2c627 Revert "Remove split functional wrapper (#74727)"
This reverts commit a58876ace7.

Reverted https://github.com/pytorch/pytorch/pull/74727 on behalf of https://github.com/seemethere due to Fails internal use cases, might extend out to external use cases as well. Need to assess overall impact of this change more widely
2022-08-10 19:45:23 +00:00
Peter Bell
a58876ace7 Remove split functional wrapper (#74727)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74727
Approved by: https://github.com/albanD, https://github.com/khabinov
2022-08-10 17:57:48 +00:00
Kurt Mohler
be5b3df6cc Update std_mean/var_mean/nanmean/nansum signatures with int[1]? dim (#82912)
### Description
Change the type of the `dim` arg for `std_mean/var_mean/nanmean/nansum` to `int[1]?` in `native_functions.yaml`

### Issue
Part of #29137

### Testing

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82912
Approved by: https://github.com/albanD
2022-08-10 16:58:26 +00:00
Kurt Mohler
5ca9b2b6fa Enable dim=None for torch.var (#82765)
### Description
Add support for `dim=None` in `torch.var`

### Issue
Part of #29137

### Testing
N/A
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82765
Approved by: https://github.com/albanD
2022-08-04 20:47:27 +00:00
Pearu Peterson
ff5399e528 Revise sparse docs regarding Sparse Compressed tensors (#82108)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82108
Approved by: https://github.com/bhosmer
2022-07-29 18:15:09 +00:00
ProGamerGov
8def154e00 Fix multiple docstring type mistakes (#82474)
### Description

* Docstrings using `(tuple of ints)` shows up as `(tuple of python:ints)`, so I fixed them by making the `int` no longer plural. Example: https://pytorch.org/docs/stable/generated/torch.permute.html#torch.permute
* A docstring type in JIT had one of its types incorrectly highlighted as code. Example: https://pytorch.org/docs/stable/generated/torch.jit.script.html#torch.jit.script
* I found some docstring type usages of `string` that had not yet been converted to `str` after #82410
* Some docstrings incorrectly listed their defaults inside the docstring types.
* I also found a docstring that was missing its type

### Testing
No testing should be required.

---

In the developer guidelines, there should probably be standards listed for the docstring types.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82474
Approved by: https://github.com/albanD
2022-07-29 17:45:37 +00:00
Fabio Rocha
fd84c458f4 Add torch.unflatten and improve its docs (#81399)
unflatten now has a free function version in torch.flatten in addition to
    the method in torch.Tensor.flatten.

    Updated docs to reflect this and polished them a little.
    For consistency, changed the signature of the int version of unflatten in
    native_functions.yaml.

    Some override tests were failing because unflatten has unusual
    characteristics in terms of the .int and .Dimname versions having
    different number of arguments so this required some changes
    to test/test_override.py

    Removed support for using mix of integer and string arguments
    when specifying dimensions in unflatten.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81399
Approved by: https://github.com/Lezcano, https://github.com/ngimel
2022-07-29 15:02:42 +00:00
Kurt Mohler
2bfae07a79 Enable dim=None for torch.mean (#81286)
Part of #79525

This will require coordination with XLA before merging, just like #79881
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81286
Approved by: https://github.com/albanD
2022-07-28 22:34:56 +00:00
ProGamerGov
357b7d589c Fix docstring inconsistencies: string -> str, boolean -> bool (#82410)
### Description

Throughout the PyTorch docs and codebase, the `string` type in docstrings is referred to by two separate names. This leads to inconsistent docs, like you can see here: https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html#torch.nn.Conv3d

This PR fixes this issue by ensuring that all mentions of the string type in docstrings, are using the same format that Sphinx generates hyperlinks for.

### Testing
No testing should be required for this change

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82410
Approved by: https://github.com/jbschlosser
2022-07-28 21:29:57 +00:00
Zhengyi Li
026ef78b22 [DOC] fix a mistake in torch.dist document (#82104)
In document (https://pytorch.org/docs/stable/generated/torch.dist.html )the torch.dist(x, y, 0) returns inf.

However, it should return 4.0 and the pytorch (1.12)  does return 4.0

Pull Request resolved: https://github.com/pytorch/pytorch/pull/82104
Approved by: https://github.com/samdow
2022-07-26 13:51:31 +00:00
Huy Do
12cb26509a Apply ufmt to torch internal (#81643)
This is a big bang PR, merge conflicts are probably expected and will be addressed at merge.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81643
Approved by: https://github.com/ezyang
2022-07-22 02:19:50 +00:00
lezcano
e505796a2c [Array API] Add linalg.vecdot (#70542)
This PR adds the function `linalg.vecdot` specified by the [Array
API](https://data-apis.org/array-api/latest/API_specification/linear_algebra_functions.html#function-vecdot)

For the complex case, it chooses to implement \sum x_i y_i. See the
discussion in https://github.com/data-apis/array-api/issues/356

Edit. When it comes to testing, this function is not quite a binopt, nor a reduction opt. As such, we're this close to be able to get the extra testing, but we don't quite make it. Now, it's such a simple op that I think we'll make it without this.

Resolves https://github.com/pytorch/pytorch/issues/18027.

cc @mruberry @rgommers @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70542
Approved by: https://github.com/IvanYashchuk, https://github.com/mruberry
2022-07-12 14:28:54 +00:00
PyTorch MergeBot
7f3677d723 Revert "Remove split functional wrapper (#74727)"
This reverts commit cc3126083e.

Reverted https://github.com/pytorch/pytorch/pull/74727 on behalf of https://github.com/mehtanirav due to Breaking multiple internals builds and tests
2022-07-11 18:29:45 +00:00