Mikayla Gawarecki
1a2dcff127
Added ModuleInfos for remaining activation functions ( #97704 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97704
Approved by: https://github.com/albanD
2023-03-28 17:11:41 +00:00
Mikayla Gawarecki
a283c15e34
Added ModuleInfos for {*}LU modules ( #97375 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97375
Approved by: https://github.com/albanD , https://github.com/jbschlosser
2023-03-28 00:36:31 +00:00
Mikayla Gawarecki
236bac811a
Add ModuleInfos for Adaptive{Max/Avg}Pool ops ( #97291 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97291
Approved by: https://github.com/albanD
2023-03-27 19:45:37 +00:00
Rishub Tamirisa
152c1529ca
Add tests for all padding layers to module_db in common_modules.py ( #96641 )
...
Adding the PR discussed in #96295 .
- Adds tests for all current padding layers to `module_db` in `torch/testing/_internal/common_modules.py` ( `nn.ReflectionPad`, `nn.ReplicationPad`, `nn.ZeroPad`, `nn.ConstantPad` ) for 1D, 2D, and 3D variants.
- Removes tests for the same padding layers from `torch/testing/_internal/common_nn.py`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96641
Approved by: https://github.com/albanD
2023-03-14 17:42:10 +00:00
Rishub Tamirisa
f3b8638074
Adding nn.ZeroPad1d and nn.ZeroPad3d ( #96295 )
...
Fixes #95796
### Implementation
Adds python implementation for `nn.ZeroPad1d` and `nn.ZeroPad3d` in `torch/nn/modules/padding.py`.
Adds cpp implementation for `nn::ZeroPad1d` and `nn::ZeroPad3d` in the following 3 files, refactored with templates similarly to `nn::ConstantPad`'s implementation: <br>
- `torch/crsc/api/include/torch/nn/modules/padding.h`
- `torch/csrc/api/include/torch/nn/options/padding.h`
- `torch/csrc/api/src/nn/modules/padding.cpp`
Also added relevant definitions in `torch/nn/modules/__init__.py`.
### Testing
Adds the following tests:
- cpp tests of similar length and structure as `ConstantPad` and the existing `ZeroPad2d` impl in `test/cpp/api/modules.cpp`
- cpp API parity tests in `torch/testing/_internal/common_nn.py`
- module init tests in `test/test_module_init.py`
Also added relevant definitions in `test/cpp_api_parity/parity-tracker.md`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96295
Approved by: https://github.com/soulitzer
2023-03-10 03:51:41 +00:00
kshitij12345
3b966a6ce3
[autograd] disable backward/grad for complex scalar output ( #92753 )
...
Fixes https://github.com/pytorch/pytorch/issues/92750
Pull Request resolved: https://github.com/pytorch/pytorch/pull/92753
Approved by: https://github.com/ezyang
2023-02-23 11:38:27 +00:00
Xuehai Pan
5b1cedacde
[BE] [2/3] Rewrite super() calls in functorch and torch ( #94588 )
...
Rewrite Python built-in class `super()` calls. Only non-semantic changes should be applied.
- #94587
- #94588
- #94592
Also, methods with only a `super()` call are removed:
```diff
class MyModule(nn.Module):
- def __init__(self):
- super().__init__()
-
def forward(self, ...):
...
```
Some cases that change the semantics should be kept unchanged. E.g.:
f152a79be9/caffe2/python/net_printer.py (L184-L190)
f152a79be9/test/test_jit_fuser_te.py (L2628-L2635)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94588
Approved by: https://github.com/ezyang , https://github.com/albanD
2023-02-10 21:16:33 +00:00
Aaron Gokaslan
8fce9a09cd
[BE]: pyupgrade Python to 3.8 - imports and object inheritance only ( #94308 )
...
Apply parts of pyupgrade to torch (starting with the safest changes).
This PR only does two things: removes the need to inherit from object and removes unused future imports.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94308
Approved by: https://github.com/ezyang , https://github.com/albanD
2023-02-07 21:10:56 +00:00
Driss Guessous
912748e3b7
[SDP] Fix alignment check for efficient_attention ( #90413 )
...
Fixes a bug found using head_dim_size==100 on an a100 gpu. This PR contains stricter guards on the input shape. These constraints are taken from xformers: https://github.com/facebookresearch/xformers/blob/gh/danthe3rd/60/orig/xformers/ops/fmha/cutlass.py#L23
Pull Request resolved: https://github.com/pytorch/pytorch/pull/90413
Approved by: https://github.com/mikekgfb
2022-12-09 21:09:25 +00:00
Kshiteej K
c651944f92
[test_nn] split hooks test from test_nn ( #89201 )
...
Ref: https://github.com/pytorch/pytorch/issues/63085
Note: Doesn't need corresponding XLA PR as the migrated tests were not run on XLA (as they weren't in TestNNDeviceType).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89201
Approved by: https://github.com/albanD
2022-11-23 08:39:45 +00:00
breidct
7d9e546738
Replace assertEqualIgnoreTypes in common_nn.py ( #84210 )
...
See #38095
Replaced all instances of assertEqualIgnoreTypes in common_nn.py with assertEqual
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84210
Approved by: https://github.com/kit1980
2022-09-01 16:16:45 +00:00
kshitij12345
7a8152530d
move pooling test from test_nn to test/nn/test_pooling ( #83915 )
...
Ref #63085
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83915
Approved by: https://github.com/albanD
2022-08-24 16:17:50 +00:00
lezcano
b5b9db9f84
Make kl_div a composite function. ( #80334 )
...
Benchmarks: https://github.com/pytorch/pytorch/pull/80334#issuecomment-1167229285
Fixes https://github.com/pytorch/pytorch/issues/80158
Fixes https://github.com/pytorch/pytorch/issues/78867
Fixes https://github.com/pytorch/pytorch/issues/69230
Supersedes https://github.com/pytorch/pytorch/pull/79007
Supersedes https://github.com/pytorch/pytorch/pull/69212
Supersedes https://github.com/pytorch/pytorch/pull/19659
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80334
Approved by: https://github.com/ezyang
2022-07-13 20:07:36 +00:00
PyTorch MergeBot
f2c8557521
Revert "Make kl_div a composite function. ( #80334 )"
...
This reverts commit 828c787ea9 .
Reverted https://github.com/pytorch/pytorch/pull/80334 on behalf of https://github.com/ezyang due to doesn't work with xla
2022-07-06 17:51:06 +00:00
lezcano
828c787ea9
Make kl_div a composite function. ( #80334 )
...
Benchmarks: https://github.com/pytorch/pytorch/pull/80334#issuecomment-1167229285
Fixes https://github.com/pytorch/pytorch/issues/80158
Fixes https://github.com/pytorch/pytorch/issues/78867
Fixes https://github.com/pytorch/pytorch/issues/69230
Supersedes https://github.com/pytorch/pytorch/pull/79007
Supersedes https://github.com/pytorch/pytorch/pull/69212
Supersedes https://github.com/pytorch/pytorch/pull/19659
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80334
Approved by: https://github.com/ezyang
2022-07-04 19:33:43 +00:00
Eddie Yan
b740a99b9e
[cuDNN][TF32] Threshold adjustments for TF32 on >=sm80 ( #78437 )
...
CC @ptrblck @mcarilli
Change to transformer multilayer test can potentially be swapped in favor of an rtol change? (see also: #75612 ).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78437
Approved by: https://github.com/ngimel
2022-06-03 01:02:56 +00:00
Ryan Spring
4f8b986e28
Implement Tanh Gelu Approximation ( #61439 )
...
Summary:
1. Implements https://github.com/pytorch/pytorch/issues/39853
2. Adds approximate boolean flag to Gelu
3. Enables Tanh Gelu approximation
4. Adds double backward support for Gelu
5. Enable Tanh Gelu in NvFuser
```
def gelu(x, approximate : str = 'none'):
if approximate == 'tanh':
# sqrt(2/pi) = 0.7978845608028654
return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * (x + 0.044715 * torch.pow(x, 3.0))))
else:
return x * normcdf(x)
```
Linking XLA PR - https://github.com/pytorch/xla/pull/3039
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61439
Reviewed By: VitalyFedyunin
Differential Revision: D33894937
Pulled By: jbschlosser
fbshipit-source-id: b65e8fb6ea66168af8f34f45ed50e92737a33851
(cherry picked from commit 6e986f91a9 )
2022-02-14 03:40:32 +00:00
Nikita Shulga
74c44ba9d6
Revert D33850228: [pytorch][PR] Implement Tanh Gelu Approximation
...
Test Plan: revert-hammer
Differential Revision:
D33850228 (23d03025dc )
Original commit changeset: 3cc33fb298e4
Original Phabricator Diff: D33850228 (23d03025dc )
fbshipit-source-id: 9436e7df73c2b2e2011f321674f24973316d3692
(cherry picked from commit c9efb58223 )
2022-01-31 17:44:19 +00:00
Ryan Spring
23d03025dc
Implement Tanh Gelu Approximation ( #61439 )
...
Summary:
1. Implements https://github.com/pytorch/pytorch/issues/39853
2. Adds approximate boolean flag to Gelu
3. Enables Tanh Gelu approximation
4. Adds double backward support for Gelu
5. Enable Tanh Gelu in NvFuser
```
def gelu(x, approximate : str = 'none'):
if approximate == 'tanh':
# sqrt(2/pi) = 0.7978845608028654
return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * (x + 0.044715 * torch.pow(x, 3.0))))
else:
return x * normcdf(x)
```
Linking XLA PR - https://github.com/pytorch/xla/pull/3039
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61439
Reviewed By: cpuhrsch
Differential Revision: D33850228
Pulled By: jbschlosser
fbshipit-source-id: 3cc33fb298e480d7ecc5c67716da019d60c6ab33
(cherry picked from commit 3a53b3e94f )
2022-01-31 17:07:45 +00:00
Joel Schlosser
cb823d9f07
Revert D33744717: [pytorch][PR] Implement Tanh Gelu Approximation
...
Test Plan: revert-hammer
Differential Revision:
D33744717 (f499ab9cef )
Original commit changeset: d64532a562ed
Original Phabricator Diff: D33744717 (f499ab9cef )
fbshipit-source-id: 396c3f63de5865f894dbc353d0790a01a624be93
(cherry picked from commit e9fb2d1db1 )
2022-01-28 18:35:01 +00:00
Ryan Spring
f499ab9cef
Implement Tanh Gelu Approximation ( #61439 )
...
Summary:
1. Implements https://github.com/pytorch/pytorch/issues/39853
2. Adds approximate boolean flag to Gelu
3. Enables Tanh Gelu approximation
4. Adds double backward support for Gelu
5. Enable Tanh Gelu in NvFuser
```
def gelu(x, approximate : str = 'none'):
if approximate == 'tanh':
# sqrt(2/pi) = 0.7978845608028654
return 0.5 * x * (1.0 + torch.tanh(0.7978845608028654 * (x + 0.044715 * torch.pow(x, 3.0))))
else:
return x * normcdf(x)
```
Linking XLA PR - https://github.com/pytorch/xla/pull/3039
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61439
Reviewed By: mikaylagawarecki
Differential Revision: D33744717
Pulled By: jbschlosser
fbshipit-source-id: d64532a562ed53247bb4fa52bb16722634d5c187
(cherry picked from commit 4713dd9cca )
2022-01-28 16:59:09 +00:00
soulitzer
25e84fa4e5
Add forward AD formulas for some losses ( #71026 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71026
...and fmod
Testing:
- L1Loss: new module tests (linear in the real case only)
- SmoothL1Loss: new module tests
- MSELoss: tested - OpInfo + new module tests
- huberloss: tested - OpInfo + new module tests
- multi-margin-loss: new module tests
- kl-div: OpInfo + new module tests
- fmod: OpInfo
Test Plan: Imported from OSS
Reviewed By: albanD
Differential Revision: D33485661
Pulled By: soulitzer
fbshipit-source-id: 542ef5148183b9f574d06b2e2e345d0d889537b7
(cherry picked from commit 60765438e8 )
2022-01-26 16:31:26 +00:00
kshitij12345
a421ee0e52
[nn] InstanceNorm : no batch dim for modules ( #65323 )
...
Summary:
Reference: https://github.com/pytorch/pytorch/issues/60585
cc albanD mruberry jbschlosser walterddr kshitij12345
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65323
Reviewed By: davidberard98
Differential Revision: D33285268
Pulled By: jbschlosser
fbshipit-source-id: c5210bb431eaf27190e1cd75c42af3e5bcf83f72
2021-12-22 18:00:36 -08:00
George Qi
7c690ef1c2
FractionalMaxPool3d with no_batch_dim support ( #69732 )
...
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69732
Test Plan: Imported from OSS
Reviewed By: jbschlosser
Differential Revision: D33280090
Pulled By: george-qi
fbshipit-source-id: aaf90a372b6d80da0554bad28d56436676f9cb89
2021-12-22 14:30:32 -08:00
kshitij12345
7407e3d6fd
[fix] cross_entropy : fix weight with ignore_index and label_smoothing ( #69511 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/69339
cc albanD mruberry jbschlosser walterddr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69511
Reviewed By: mrshenli
Differential Revision: D32951935
Pulled By: jbschlosser
fbshipit-source-id: 482eae851861a32f96bd6231dd3448fb6d44a015
2021-12-08 12:08:33 -08:00
kshitij12345
828a9dcc04
[nn] MarginRankingLoss : no batch dim ( #64975 )
...
Summary:
Reference: https://github.com/pytorch/pytorch/issues/60585
cc albanD mruberry jbschlosser walterddr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64975
Reviewed By: albanD
Differential Revision: D31906528
Pulled By: jbschlosser
fbshipit-source-id: 1127242a859085b1e06a4b71be19ad55049b38ba
2021-10-26 09:03:31 -07:00
Eddie Yan
d9c4b3feab
Do rowwisemoments computation in float for half LayerNorm ( #66920 )
...
Summary:
https://github.com/pytorch/pytorch/issues/66707
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66920
Reviewed By: mrshenli
Differential Revision: D31850612
Pulled By: ngimel
fbshipit-source-id: a95a33567285dcf9ee28d33f503cead3268960f9
2021-10-22 09:50:42 -07:00
kshitij12345
1db50505d5
[nn] MultiLabelSoftMarginLoss : no batch dim support ( #65690 )
...
Summary:
Reference: https://github.com/pytorch/pytorch/issues/60585
cc albanD mruberry jbschlosser walterddr
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65690
Reviewed By: zou3519
Differential Revision: D31731162
Pulled By: jbschlosser
fbshipit-source-id: d26f27555f78afdadd49126e0548a8bfda50cc5a
2021-10-18 15:30:01 -07:00
Gary Miguel
543b7fb942
[JIT] Fix type annotations of pooling modules ( #65847 )
...
Summary:
All of the pooling modules except MaxUnpool and LPPool return either a
Tensor or [Tensor, Tensor]. The current type annotations are inaccurate,
and prevent scripting the module if return_indices is set as True in the
module.
There's not a great way to make this agree with mypy because the
overload is dependent on the value of return_indices, an attribute.
I tried changing the annotations from `Tensor` to
`Union[Tensor, Tuple[Tensor, Tensor]]`, but that breaks a bunch of uses
that have return_indices=False.
For example, this breaks:
4e94e84f65/torch/nn/modules/container.py (L139)
Also clean up how test names were being constructed in test_jit, since
otherwise we were getting name collisions when there were two tests on
the same nn.Module.
Fixes https://github.com/pytorch/pytorch/issues/45904
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65847
Reviewed By: ZolotukhinM
Differential Revision: D31462517
Pulled By: eellison
fbshipit-source-id: 6f9e8df1be6c75e5e1e9bae07cf3ad3603ba59bd
2021-10-14 10:59:19 -07:00
kshitij12345
a012216b96
[nn] Fold : no batch dim ( #64909 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/64907
Reference: https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64909
Reviewed By: cpuhrsch, heitorschueroff
Differential Revision: D30991087
Pulled By: jbschlosser
fbshipit-source-id: 91a37e0b1d51472935ff2308719dfaca931513f3
2021-09-23 08:37:32 -07:00
kshitij12345
9c23f6eb7d
[nn] TripletMarginLoss and PairwiseDistance : no batch dim ( #64882 )
...
Summary:
Reference: https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64882
Reviewed By: malfet
Differential Revision: D31055577
Pulled By: jbschlosser
fbshipit-source-id: 2f0a5a08619b672026b48a78bc7d83a6dccba0bf
2021-09-21 07:29:48 -07:00
Xiang Gao
816048e7e6
EmbeddingBag sort thrust->cub ( #64498 )
...
Summary:
Partially fixes https://github.com/pytorch/pytorch/issues/57505
Also fixes a warning I found when compiling:
```
/home/gaoxiang/pytorch-cub/torch/csrc/distributed/c10d/quantization/quantization_gpu.cu(7): warning: inline qualifier ignored for "__global__" function
```
I also updated the bfloat16 guard to CUDA 11.5
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64498
Reviewed By: mruberry
Differential Revision: D30917077
Pulled By: ngimel
fbshipit-source-id: fb9df08fd469038478a563014b5af7452b4b28c0
2021-09-13 19:51:12 -07:00
kshitij12345
01e92f2a56
[nn] no batch dim support: CosineEmbeddingLoss ( #64590 )
...
Summary:
Reference: https://github.com/pytorch/pytorch/issues/60585
TODO
* [x] Add tests
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64590
Reviewed By: H-Huang
Differential Revision: D30900775
Pulled By: jbschlosser
fbshipit-source-id: d24e72787017e79afbf8f04a94901a290485b81a
2021-09-13 10:45:33 -07:00
Thomas J. Fan
7d010539c9
ENH Adds test and docs for modules that already support no batch dims ( #62729 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62729
Reviewed By: H-Huang
Differential Revision: D30669546
Pulled By: jbschlosser
fbshipit-source-id: c771c98c1fd9d28fa984b72893585c738c736505
2021-09-02 12:36:54 -07:00
Thomas J. Fan
d3bcba5f85
ENH Adds label_smoothing to cross entropy loss ( #63122 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/7455
Partially resolves pytorch/vision#4281
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63122
Reviewed By: iramazanli
Differential Revision: D30586076
Pulled By: jbschlosser
fbshipit-source-id: 06afc3aa1f8b9edb07fe9ed68c58968ad1926924
2021-08-29 23:33:04 -07:00
Xiang Gao
227cb268bc
[Reland] Embedding thrust->cub migration ( #63806 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/63427
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63806
Reviewed By: bdhirsh
Differential Revision: D30498255
Pulled By: ngimel
fbshipit-source-id: 78b7085a92a168cf0163f53dcb712bac922f5235
2021-08-24 09:30:32 -07:00
Thomas J. Fan
2ca2761f3c
ENH Adds no_batch_dim for NLLLoss ( #62651 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62651
Reviewed By: VitalyFedyunin
Differential Revision: D30303340
Pulled By: jbschlosser
fbshipit-source-id: 7ab478cf63bf6cd1f850cad5fd101e74a2cfe3f5
2021-08-24 08:27:27 -07:00
Thomas J. Fan
9914fb6615
ENH Adds no_batch_dim tests/docs for LPPool1d and Identity ( #62190 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62190
Reviewed By: ejguan
Differential Revision: D29942385
Pulled By: jbschlosser
fbshipit-source-id: 00df6f6f01ad039631bb8679f8de94863aac7650
2021-08-24 06:59:41 -07:00
Thomas J. Fan
c5f3ab6982
ENH Adds no_batch_dim to FractionalMaxPool2d ( #62490 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62490
Reviewed By: bdhirsh
Differential Revision: D30287143
Pulled By: jbschlosser
fbshipit-source-id: 1b9dd932157f571adf3aa2c98c3c6b56ece8fa6e
2021-08-13 08:48:40 -07:00
Thomas J. Fan
59d09b148c
BUG Fixes bug in no_batch_dim tests ( #62726 )
...
Summary:
The way that Python captures variables for lambdas meant that only the last `input_fn`, etc were captured. This PR adds makes sure the local variable to captured by a lambda.
REF: https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62726
Reviewed By: zou3519
Differential Revision: D30159478
Pulled By: jbschlosser
fbshipit-source-id: cfef3d9776d2676b2f5bb6d39d569b8ca07b0fe5
2021-08-06 11:11:25 -07:00
Joel Schlosser
a42345adee
Support for target with class probs in CrossEntropyLoss ( #61044 )
...
Summary:
Fixes https://github.com/pytorch/pytorch/issues/11959
Alternative approach to creating a new `CrossEntropyLossWithSoftLabels` class. This PR simply adds support for "soft targets" AKA class probabilities to the existing `CrossEntropyLoss` and `NLLLoss` classes.
Implementation is dumb and simple right now, but future work can add higher performance kernels for this case.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61044
Reviewed By: zou3519
Differential Revision: D29876894
Pulled By: jbschlosser
fbshipit-source-id: 75629abd432284e10d4640173bc1b9be3c52af00
2021-07-29 10:04:41 -07:00
Thomas J. Fan
80a662e773
ENH Updates docs and tests for classification modules that already support no batch dims ( #61874 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61874
Reviewed By: heitorschueroff
Differential Revision: D29979977
Pulled By: jbschlosser
fbshipit-source-id: 82c19151aa7220e564337b05d7677d52981e0aa2
2021-07-29 09:14:52 -07:00
Joel Schlosser
35307b131d
Callable activation function support for Transformer modules (Python) ( #61355 )
...
Summary:
Fixes Python part of https://github.com/pytorch/pytorch/issues/60747
Enhances the Python versions of `Transformer`, `TransformerEncoderLayer`, and `TransformerDecoderLayer` to support callables as their activation functions. The old way of specifying activation function still works as well.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61355
Reviewed By: bdhirsh
Differential Revision: D29967302
Pulled By: jbschlosser
fbshipit-source-id: 8ee6f20083d49dcd3ab432a18e6ad64fe1e05705
2021-07-28 21:42:56 -07:00
Thomas J. Fan
7c588d5d00
ENH Adds no_batch_dim support for pad 2d and 3d ( #62183 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62183
Reviewed By: ejguan
Differential Revision: D29942250
Pulled By: jbschlosser
fbshipit-source-id: d1df4ddcb90969332dc1a2a7937e66ecf46f0443
2021-07-28 11:10:44 -07:00
Thomas J. Fan
89ca638c18
ENH Adds no batch dim support for AdativeMaxPool*D ( #61847 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61847
Reviewed By: suo
Differential Revision: D29883887
Pulled By: jbschlosser
fbshipit-source-id: de3fcf1cc3878b138ab766d2a50cc59c52ec5a60
2021-07-26 07:35:36 -07:00
Thomas J. Fan
f03e7170f0
ENH Updates docs and tests for regression modules that already support no-batch-dims ( #61461 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
This PR does not use `check_sum_reduction` because I wanted to test every reduction option.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61461
Reviewed By: suo
Differential Revision: D29883744
Pulled By: jbschlosser
fbshipit-source-id: cdad0effb41f0484938caad0d4c9d6d83e2aec07
2021-07-23 16:40:17 -07:00
Thomas J. Fan
0309c5780d
ENH Adds no batch dim support for AvgPool1d ( #61860 )
...
Summary:
Towards https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61860
Reviewed By: albanD
Differential Revision: D29826382
Pulled By: jbschlosser
fbshipit-source-id: 47e12073d866f0604310fc1ff270cde9907e516d
2021-07-22 12:46:48 -07:00
Thomas J. Fan
48af9de92f
ENH Enables No-batch for *Pad1d Modules ( #61060 )
...
Summary:
Toward https://github.com/pytorch/pytorch/issues/60585
This PR adds a `single_batch_reference_fn` that uses the single batch implementation to check no-batch.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61060
Reviewed By: mrshenli
Differential Revision: D29739823
Pulled By: jbschlosser
fbshipit-source-id: d90d88a3671177a647171801cc6ec7aa3df35482
2021-07-21 07:12:41 -07:00
soulitzer
1b0a7f3887
Always use fast gradcheck for LayerNorm 3d_no_affine_large_feature ( #61848 )
...
Summary:
Due to the introduction of a test from https://github.com/pytorch/pytorch/pull/59987/files , slow gradcheck has been failing intermittently (timing out/getting killed).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61848
Reviewed By: mrshenli
Differential Revision: D29765773
Pulled By: soulitzer
fbshipit-source-id: d78bee758cab76f26ba9f54925c42d4825db9449
2021-07-19 12:33:55 -07:00
Thomas J. Fan
24a6eb3fda
ENH Adds tests and docs for 2d & 3d modules that already support no batch ( #61262 )
...
Summary:
Toward https://github.com/pytorch/pytorch/issues/60585
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61262
Reviewed By: mrshenli
Differential Revision: D29660554
Pulled By: jbschlosser
fbshipit-source-id: d5e3dc7096fcf8621bce4a1063d521b84092e0ca
2021-07-19 11:12:28 -07:00