Commit cc322e2
committed
Update on "De-prioritise Dimname and DimnameList in python overload resolution"
`None` being a valid `Dimname` is awkward for optional `dim` arguments, as found
on NumPy's reduction functions like `std` and `var`. In these cases `dim=None`
should mean an all-reduction, but instead you get an error
"Please look up dimensions by name".
I've also had to fix `FunctionParameter::check` to actually check the first
element of `INT_LIST` arguments and reject non-int types. Otherwise, the dim
names end up calling the `int[]` overload and fail.
[ghstack-poisoned]797 files changed
Lines changed: 27865 additions & 8424 deletions
File tree
- .circleci
- cimodel/data
- simple
- docker
- scripts
- verbatim-sources/job-specs
- .github
- scripts
- workflows
- .jenkins/pytorch
- android
- gradle/wrapper
- test_app/app
- aten/src
- ATen
- core
- boxing
- impl
- dispatch
- op_registration
- cpu/vec256
- vsx
- cuda
- detail
- native
- cpu
- cuda
- cudnn
- metal
- mpscnn
- tests
- mkldnn
- mkl
- quantized
- cpu
- kernels
- cuda
- sparse/cuda
- utils
- vulkan
- api
- glsl
- ops
- quantized
- templates
- test
- THCUNN/generic
- THC
- generated
- generic
- benchmarks
- cpp/tensorexpr
- operator_benchmark
- pt
- static_runtime
- tensorexpr
- c10
- core
- cuda
- macros
- test/util
- util
- caffe2
- contrib
- aten
- fakelowp
- tensorrt
- core
- nomnigraph
- Representations
- include/nomnigraph
- Representations
- Support
- Transformations
- tests
- image
- operators
- rnn
- opt
- custom
- proto
- python
- layers
- mint
- models
- seq2seq
- onnx
- operator_test
- predictor
- serialize
- sgd
- utils/math
- cmake
- Modules
- public
- docs/source
- mypy_plugins
- test
- cpp
- api
- jit
- rpc
- tensorexpr
- custom_backend
- distributed
- algorithms/ddp_comm_hooks
- expect
- jit
- mobile/custom_build
- onnx
- expect
- quantization
- third_party
- tools
- autograd
- code_analyzer
- code_coverage/package/oss
- codegen
- api
- pyi
- torch
- _C
- autograd
- backends/_nnapi
- csrc
- autograd
- functions
- deploy
- example
- interpreter
- distributed
- c10d
- rpc
- testing
- jit
- api
- backends
- codegen
- cuda
- fuser/cpu
- frontend
- ir
- passes
- onnx
- python
- runtime
- static
- serialization
- tensorexpr
- onnx
- tensor
- utils
- cuda
- amp
- distributed
- optim
- rpc
- fx
- experimental
- jit
- lib/c10d
- test
- nn
- modules
- parallel
- quantizable/modules
- quantized/modules
- onnx
- optim
- package
- quantization
- fx
- ns
- testing
- _internal
- distributed
- rpc
- utils
- benchmark/utils
- data
- _utils
- datapipes
- iter
- utils
- hipify
- tensorboard
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 9 | | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
21 | 16 | | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| 30 | + | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
0 commit comments