9 Commits

Author SHA1 Message Date
75cfc0be21 Logcumsumexp for CPU (#93153)
Partial work from #90847, in the direction of solving #89205.
Most of the content is from #90847, but this is only for CPU, so hopefully it does not increase the build time by a lot.

tag: @albanD, @malfet

Pull Request resolved: https://github.com/pytorch/pytorch/pull/93153
Approved by: https://github.com/malfet, https://github.com/Skylion007
2023-01-27 22:29:33 +00:00
44cc873fba [PyTorch] Autoformat c10 (#56830)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/56830

Opt into formatting on GitHub and format everything. This is a trial run before turning on formatting for more and eventually all of the codebase.

Test Plan: CI

Reviewed By: zertosh

Differential Revision: D27979080

fbshipit-source-id: a80f0c48691c08ae8ca0af06377b87e6a2351151
2021-04-30 21:23:28 -07:00
263412e536 Rename is_complex_t -> is_complex (#39906)
Summary:
`is_complex_t` is a bad name. For example in std, there are `std::is_same` but not `std::is_same_t`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/39906

Reviewed By: mrshenli

Differential Revision: D22665013

Pulled By: anjali411

fbshipit-source-id: 4b71745f5e2ea2d8cf5845d95ada4556c87e040d
2020-09-01 21:04:19 -07:00
c7d79f35e3 Header rename complex_type.h -> complex.h (#39885)
Summary:
This file should have been renamed as `complex.h`, but unfortunately, it was named as `complex_type.h` due to a name clash with FBCode. Is this still the case and is it easy to resolve the name clash? Maybe related to the comment at https://github.com/pytorch/pytorch/pull/39834#issuecomment-642950012
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39885

Differential Revision: D22018575

Pulled By: ezyang

fbshipit-source-id: e237ccedbe2b30c31aca028a5b4c8c063087a30f
2020-06-23 16:27:09 -07:00
df2d19723a c10/util/complex_math.h and c10/util/complex_utils.h should not be individually included (#39276)
Summary:
Add a compilation error if they are individually included. Devs should
instead include c10/util/complex_type.h (which includes these two files).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39276

Differential Revision: D21924922

Pulled By: ezyang

fbshipit-source-id: ad1034be5d9d694b18cc5f03a44f540f10de568c
2020-06-08 11:52:18 -07:00
bdaa78499e Reland Refactor c10::complex and cleanup c10::Scalar (#39306)
Summary:
This reverts commit 8556664d6896a8e7f48f1c419e06e0568b9ee09e.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39306

Differential Revision: D21818096

Pulled By: albanD

fbshipit-source-id: ed4396fcad8c7036fb7bfa2f3da6ed63c0eb6625
2020-06-01 11:51:57 -07:00
8556664d68 Revert D21769463: [pytorch][PR] Refactor c10::complex and cleanup c10::Scalar
Test Plan: revert-hammer

Differential Revision:
D21769463

Original commit changeset: 3cb5bcbb0ff3

fbshipit-source-id: 0392e23d7057f90e7b13c9abf19bcca2d84b26fa
2020-05-30 18:02:51 -07:00
928ce29ee2 Refactor c10::complex and cleanup c10::Scalar (#38593)
Summary:
**Main:**
- `c10::complex` is refactored: it no longer uses inheritance to specialize constructors, but using SFINAE instead. This implementation is cleaner and avoids some compiler bugs.
- `c10::Scalar` is cleaned up: it no longer needs to store complex as `double z[2]`, `c10::complex<double>` will work.

**Other cleanups:**
- `numeric_limits` of `c10::complex` is moved to `complex_utils.h`
- the variable in `c10::complex` storing real and imag is changed from `storage[2]` to `real_` and `imag_`
- remove the `c10::` before `complex` when in `c10` namespace
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38593

Differential Revision: D21769463

Pulled By: anjali411

fbshipit-source-id: 3cb5bcbb0ff304d137221e00fe481a08dba7bc12
2020-05-30 13:33:51 -07:00
681c6fb60f Move complex utilities out of Half.h (#37676)
Summary:
There is no reason to put complex utilities to half header.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37676

Differential Revision: D21440270

Pulled By: anjali411

fbshipit-source-id: bbed5fcb5be33f6a4aedcc9932595d43d97672f6
2020-05-06 19:46:05 -07:00