torch-rb 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,6 +39,7 @@
39
39
 
40
40
  # Computes the gradient of current tensor w.r.t. graph leaves.
41
41
  - func: backward(Tensor self, Tensor? gradient=None, bool keep_graph=False, bool create_graph=False) -> ()
42
+ manual_kernel_registration: True
42
43
  variants: method
43
44
 
44
45
  # DEPRECATED. Sets the tensor data held by this `Variable` to be the same as
@@ -49,14 +50,19 @@
49
50
  # where Variables *are* Tensors (as opposed to them containing tensors, which
50
51
  # is what the previous interpretation was.)
51
52
  - func: set_data(Tensor(a!) self, Tensor new_data) -> ()
52
- use_c10_dispatcher: unboxed_only
53
+ use_c10_dispatcher: full
54
+ manual_kernel_registration: True
53
55
  variants: method
54
56
 
55
57
  - func: data(Tensor self) -> Tensor
58
+ use_c10_dispatcher: full
59
+ manual_kernel_registration: True
56
60
  variants: method
57
61
 
58
62
  # True if this `Variable` is a leaf and thus does not have a `grad_fn`.
59
63
  - func: is_leaf(Tensor self) -> bool
64
+ use_c10_dispatcher: full
65
+ manual_kernel_registration: True
60
66
  variants: method
61
67
 
62
68
  # Returns the output index of this variable from the forward operation that
@@ -70,13 +76,24 @@
70
76
  # assert y2.output_nr == 2
71
77
  #
72
78
  - func: output_nr(Tensor self) -> int
79
+ use_c10_dispatcher: full
80
+ manual_kernel_registration: True
73
81
  variants: method
74
82
  supports_named_tensor: True
75
83
 
76
84
  - func: _version(Tensor self) -> int
85
+ use_c10_dispatcher: full
86
+ manual_kernel_registration: True
77
87
  variants: method
78
88
 
79
89
  - func: requires_grad_(Tensor(a!) self, bool _requires_grad=True) -> Tensor(a!)
90
+ manual_kernel_registration: True
91
+ variants: method
92
+
93
+ # Enables .grad attribute for non-leaf Tensors.
94
+ - func: retain_grad(Tensor(a!) self) -> ()
95
+ use_c10_dispatcher: full
96
+ manual_kernel_registration: True
80
97
  variants: method
81
98
 
82
99
  - func: rename_(Tensor(a!) self, Dimname[]? names) -> Tensor(a!)
@@ -123,6 +140,9 @@
123
140
  dispatch:
124
141
  CUDA: _cudnn_ctc_loss
125
142
 
143
+ - func: _use_cudnn_rnn_flatten_weight() -> bool
144
+ use_c10_dispatcher: full
145
+
126
146
  - func: _cudnn_rnn_flatten_weight(Tensor[] weight_arr, int weight_stride0, int input_size, int mode, int hidden_size, int num_layers, bool batch_first, bool bidirectional) -> Tensor
127
147
  dispatch:
128
148
  CUDA: _cudnn_rnn_flatten_weight
@@ -209,48 +229,30 @@
209
229
  supports_named_tensor: True
210
230
 
211
231
  - func: angle(Tensor self) -> Tensor
232
+ use_c10_dispatcher: full
212
233
  variants: function, method
213
234
  supports_named_tensor: True
214
- named_guard: False
215
235
 
216
236
  - func: angle.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
217
- named_guard: False
218
237
  supports_named_tensor: True
219
- dispatch:
220
- CPU: _angle_out_cpu
221
238
 
222
239
  - func: real(Tensor self) -> Tensor
223
- variants: function, method
224
- named_guard: False
225
- supports_named_tensor: True
226
-
227
- - func: real.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
228
- named_guard: False
240
+ use_c10_dispatcher: full
241
+ variants: function
229
242
  supports_named_tensor: True
230
- dispatch:
231
- CPU: _real_out_cpu
232
243
 
233
244
  - func: imag(Tensor self) -> Tensor
234
- variants: function, method
235
- named_guard: False
236
- supports_named_tensor: True
237
-
238
- - func: imag.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
239
- named_guard: False
245
+ use_c10_dispatcher: full
246
+ variants: function
240
247
  supports_named_tensor: True
241
- dispatch:
242
- CPU: _imag_out_cpu
243
248
 
244
249
  - func: conj(Tensor self) -> Tensor
250
+ use_c10_dispatcher: full
245
251
  variants: function, method
246
- named_guard: False
247
252
  supports_named_tensor: True
248
253
 
249
254
  - func: conj.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
250
- named_guard: False
251
255
  supports_named_tensor: True
252
- dispatch:
253
- CPU: _conj_out_cpu
254
256
 
255
257
  - func: acos(Tensor self) -> Tensor
256
258
  use_c10_dispatcher: full
@@ -395,12 +397,16 @@
395
397
  use_c10_dispatcher: full
396
398
 
397
399
  - func: argmax(Tensor self, int? dim=None, bool keepdim=False) -> Tensor
398
- use_c10_dispatcher: full
399
400
  variants: function, method
401
+ dispatch:
402
+ CPU: argmax
403
+ CUDA: argmax
400
404
 
401
405
  - func: argmin(Tensor self, int? dim=None, bool keepdim=False) -> Tensor
402
- use_c10_dispatcher: full
403
406
  variants: function, method
407
+ dispatch:
408
+ CPU: argmin
409
+ CUDA: argmin
404
410
 
405
411
  - func: as_strided(Tensor(a) self, int[] size, int[] stride, int? storage_offset=None) -> Tensor(a)
406
412
  variants: function, method
@@ -473,6 +479,11 @@
473
479
 
474
480
  - func: batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps, bool cudnn_enabled) -> Tensor
475
481
 
482
+ - func: quantized_batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor mean, Tensor var, float eps, float output_scale, int output_zero_point) -> Tensor
483
+ requires_tensor: True
484
+ dispatch:
485
+ QuantizedCPU: quantized_batch_norm
486
+
476
487
  - func: _batch_norm_impl_index(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps, bool cudnn_enabled) -> (Tensor, Tensor, Tensor, Tensor, int)
477
488
 
478
489
  - func: _batch_norm_impl_index_backward(int impl_index, Tensor input, Tensor grad_output, Tensor? weight, Tensor? running_mean, Tensor? running_var, Tensor? save_mean, Tensor? save_var_transform, bool train, float eps, bool[3] output_mask, Tensor reservedSpace) -> (Tensor, Tensor, Tensor)
@@ -508,6 +519,34 @@
508
519
 
509
520
  - func: bilinear(Tensor input1, Tensor input2, Tensor weight, Tensor? bias) -> Tensor
510
521
 
522
+ - func: binary_cross_entropy(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
523
+ python_module: nn
524
+ variants: function
525
+ dispatch:
526
+ CPU: binary_cross_entropy_cpu
527
+ CUDA: binary_cross_entropy_cuda
528
+
529
+ - func: binary_cross_entropy.out(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!)
530
+ python_module: nn
531
+ variants: function
532
+ dispatch:
533
+ CPU: binary_cross_entropy_out_cpu
534
+ CUDA: binary_cross_entropy_out_cuda
535
+
536
+ - func: binary_cross_entropy_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
537
+ python_module: nn
538
+ variants: function
539
+ dispatch:
540
+ CPU: binary_cross_entropy_backward_cpu
541
+ CUDA: binary_cross_entropy_backward_cuda
542
+
543
+ - func: binary_cross_entropy_backward.grad_input(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean, *, Tensor(a!) grad_input) -> Tensor(a!)
544
+ python_module: nn
545
+ variants: function
546
+ dispatch:
547
+ CPU: binary_cross_entropy_backward_out_cpu
548
+ CUDA: binary_cross_entropy_backward_out_cuda
549
+
511
550
  - func: binary_cross_entropy_with_logits(Tensor self, Tensor target, Tensor? weight=None, Tensor? pos_weight=None, int reduction=Mean) -> Tensor
512
551
  variants: function
513
552
 
@@ -563,6 +602,34 @@
563
602
  CUDA: logical_xor_out
564
603
  supports_named_tensor: True
565
604
 
605
+ - func: logical_and(Tensor self, Tensor other) -> Tensor
606
+ variants: function, method
607
+ supports_named_tensor: True
608
+
609
+ - func: logical_and_(Tensor(a!) self, Tensor other) -> Tensor(a!)
610
+ variants: method
611
+ supports_named_tensor: True
612
+
613
+ - func: logical_and.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
614
+ dispatch:
615
+ CPU: logical_and_out
616
+ CUDA: logical_and_out
617
+ supports_named_tensor: True
618
+
619
+ - func: logical_or(Tensor self, Tensor other) -> Tensor
620
+ variants: function, method
621
+ supports_named_tensor: True
622
+
623
+ - func: logical_or_(Tensor(a!) self, Tensor other) -> Tensor(a!)
624
+ variants: method
625
+ supports_named_tensor: True
626
+
627
+ - func: logical_or.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
628
+ dispatch:
629
+ CPU: logical_or_out
630
+ CUDA: logical_or_out
631
+ supports_named_tensor: True
632
+
566
633
  - func: blackman_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
567
634
 
568
635
  - func: blackman_window.periodic(int window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
@@ -624,6 +691,10 @@
624
691
  use_c10_dispatcher: full
625
692
  supports_named_tensor: True
626
693
  variants: function, method
694
+ dispatch:
695
+ CPU: clamp
696
+ CUDA: clamp
697
+ QuantizedCPU: quantized_clamp
627
698
 
628
699
  - func: clamp_(Tensor(a!) self, Scalar? min=None, Scalar? max=None) -> Tensor(a!)
629
700
  supports_named_tensor: True
@@ -716,6 +787,7 @@
716
787
  - func: conv_transpose3d.input(Tensor input, Tensor weight, Tensor? bias=None, int[3] stride=1, int[3] padding=0, int[3] output_padding=0, int groups=1, int[3] dilation=1) -> Tensor
717
788
 
718
789
  - func: copy_(Tensor(a!) self, Tensor src, bool non_blocking=False) -> Tensor(a!)
790
+ manual_kernel_registration: True
719
791
  variants: method
720
792
  device_guard: False
721
793
  supports_named_tensor: True
@@ -783,7 +855,11 @@
783
855
  dispatch:
784
856
  CUDA: cudnn_batch_norm_backward
785
857
 
786
- - func: cudnn_convolution(Tensor self, Tensor weight, Tensor? bias, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
858
+ - func: cudnn_convolution.deprecated(Tensor self, Tensor weight, Tensor? bias, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
859
+ dispatch:
860
+ CUDA: cudnn_convolution_deprecated
861
+
862
+ - func: cudnn_convolution(Tensor self, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
787
863
  dispatch:
788
864
  CUDA: cudnn_convolution
789
865
 
@@ -791,34 +867,28 @@
791
867
  dispatch:
792
868
  CUDA: cudnn_convolution_backward_input
793
869
 
794
- - func: cudnn_convolution_backward(Tensor self, Tensor grad_output, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic, bool[3] output_mask) -> (Tensor, Tensor, Tensor)
870
+ - func: cudnn_convolution_backward(Tensor self, Tensor grad_output, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic, bool[2] output_mask) -> (Tensor, Tensor)
795
871
  dispatch:
796
872
  CUDA: cudnn_convolution_backward
797
873
 
798
- - func: cudnn_convolution_backward_bias(Tensor grad_output) -> Tensor
799
- use_c10_dispatcher: full
800
- dispatch:
801
- CUDA: cudnn_convolution_backward_bias
802
-
803
874
  - func: cudnn_convolution_backward_weight(int[] weight_size, Tensor grad_output, Tensor self, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
804
875
  dispatch:
805
876
  CUDA: cudnn_convolution_backward_weight
806
877
 
807
- - func: cudnn_convolution_transpose(Tensor self, Tensor weight, Tensor? bias, int[] padding, int[] output_padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
878
+ - func: cudnn_convolution_transpose.deprecated(Tensor self, Tensor weight, Tensor? bias, int[] padding, int[] output_padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
879
+ dispatch:
880
+ CUDA: cudnn_convolution_transpose_deprecated
881
+
882
+ - func: cudnn_convolution_transpose(Tensor self, Tensor weight, int[] padding, int[] output_padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
808
883
  dispatch:
809
884
  CUDA: cudnn_convolution_transpose
810
885
 
811
886
  # NB: output_padding not strictly needed here, but it's helpful for the float
812
887
  # backwards
813
- - func: cudnn_convolution_transpose_backward(Tensor self, Tensor grad_output, Tensor weight, int[] padding, int[] output_padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic, bool[3] output_mask) -> (Tensor, Tensor, Tensor)
888
+ - func: cudnn_convolution_transpose_backward(Tensor self, Tensor grad_output, Tensor weight, int[] padding, int[] output_padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic, bool[2] output_mask) -> (Tensor, Tensor)
814
889
  dispatch:
815
890
  CUDA: cudnn_convolution_transpose_backward
816
891
 
817
- - func: cudnn_convolution_transpose_backward_bias(Tensor grad_output) -> Tensor
818
- use_c10_dispatcher: full
819
- dispatch:
820
- CUDA: cudnn_convolution_backward_bias
821
-
822
892
  - func: cudnn_convolution_transpose_backward_input(Tensor grad_output, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
823
893
  dispatch:
824
894
  CUDA: cudnn_convolution_transpose_backward_input
@@ -837,19 +907,45 @@
837
907
  dispatch:
838
908
  CUDA: cudnn_grid_sampler_backward
839
909
 
840
- - func: cumsum(Tensor self, int dim, *, ScalarType? dtype=None) -> Tensor
910
+ - func: cummax(Tensor self, int dim) -> (Tensor values, Tensor indices)
841
911
  supports_named_tensor: True
842
912
  variants: function, method
843
913
 
844
- - func: cumsum.out(Tensor self, int dim, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
914
+ - func: cummax.out(Tensor self, int dim, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)
845
915
  supports_named_tensor: True
846
916
 
847
- - func: cumsum.dimname(Tensor self, Dimname dim, *, ScalarType? dtype=None) -> Tensor
917
+ - func: cummax.dimname(Tensor self, Dimname dim) -> (Tensor values, Tensor indices)
848
918
  supports_named_tensor: True
849
919
  variants: function, method
850
920
 
851
- - func: cumsum.dimname_out(Tensor self, Dimname dim, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
921
+ - func: cummax.dimname_out(Tensor self, Dimname dim, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)
922
+ supports_named_tensor: True
923
+
924
+ - func: _cummax_helper(Tensor self, Tensor(a!) values, Tensor(b!) indices, int dim) -> ()
925
+ variants: function
926
+ dispatch:
927
+ CPU: cummax_helper_cpu
928
+ CUDA: cummax_helper_cuda
929
+
930
+ - func: cummin(Tensor self, int dim) -> (Tensor values, Tensor indices)
852
931
  supports_named_tensor: True
932
+ variants: function, method
933
+
934
+ - func: cummin.out(Tensor self, int dim, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)
935
+ supports_named_tensor: True
936
+
937
+ - func: cummin.dimname(Tensor self, Dimname dim) -> (Tensor values, Tensor indices)
938
+ supports_named_tensor: True
939
+ variants: function, method
940
+
941
+ - func: cummin.dimname_out(Tensor self, Dimname dim, *, Tensor(a!) values, Tensor(b!) indices) -> (Tensor(a!) values, Tensor(b!) indices)
942
+ supports_named_tensor: True
943
+
944
+ - func: _cummin_helper(Tensor self, Tensor(a!) values, Tensor(b!) indices, int dim) -> ()
945
+ variants: function
946
+ dispatch:
947
+ CPU: cummin_helper_cpu
948
+ CUDA: cummin_helper_cuda
853
949
 
854
950
  - func: cumprod(Tensor self, int dim, *, ScalarType? dtype=None) -> Tensor
855
951
  supports_named_tensor: True
@@ -865,6 +961,20 @@
865
961
  - func: cumprod.dimname_out(Tensor self, Dimname dim, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
866
962
  supports_named_tensor: True
867
963
 
964
+ - func: cumsum(Tensor self, int dim, *, ScalarType? dtype=None) -> Tensor
965
+ supports_named_tensor: True
966
+ variants: function, method
967
+
968
+ - func: cumsum.out(Tensor self, int dim, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
969
+ supports_named_tensor: True
970
+
971
+ - func: cumsum.dimname(Tensor self, Dimname dim, *, ScalarType? dtype=None) -> Tensor
972
+ supports_named_tensor: True
973
+ variants: function, method
974
+
975
+ - func: cumsum.dimname_out(Tensor self, Dimname dim, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
976
+ supports_named_tensor: True
977
+
868
978
  - func: ctc_loss.IntList(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank=0, int reduction=Mean, bool zero_infinity=False) -> Tensor
869
979
 
870
980
  # convenience function that converts to intlists for you
@@ -895,6 +1005,11 @@
895
1005
 
896
1006
  - func: diagonal(Tensor(a) self, int offset=0, int dim1=0, int dim2=1) -> Tensor(a)
897
1007
  variants: function, method
1008
+ supports_named_tensor: True
1009
+
1010
+ - func: diagonal.Dimname(Tensor(a) self, *, Dimname outdim, Dimname dim1, Dimname dim2, int offset=0) -> Tensor(a)
1011
+ variants: function, method
1012
+ supports_named_tensor: True
898
1013
 
899
1014
  - func: fill_diagonal_(Tensor(a!) self, Scalar fill_value, bool wrap=False) -> Tensor(a!)
900
1015
  variants: method
@@ -978,9 +1093,9 @@
978
1093
  # applying indices = indices.contiguous().
979
1094
  # The backward functions apply a check that these input tensors are contiguous.
980
1095
 
981
- - func: embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False, Tensor? per_sample_weights=None) -> (Tensor, Tensor, Tensor, Tensor)
1096
+ - func: embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False, Tensor? per_sample_weights=None, bool include_last_offset=False) -> (Tensor, Tensor, Tensor, Tensor)
982
1097
 
983
- - func: _embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False, Tensor? per_sample_weights=None) -> (Tensor, Tensor, Tensor, Tensor)
1098
+ - func: _embedding_bag(Tensor weight, Tensor indices, Tensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False, Tensor? per_sample_weights=None, bool include_last_offset=False) -> (Tensor, Tensor, Tensor, Tensor)
984
1099
  dispatch:
985
1100
  CPU: _embedding_bag_cpu
986
1101
  CUDA: _embedding_bag_cuda
@@ -1035,22 +1150,15 @@
1035
1150
  QuantizedCPU: empty_per_channel_affine_quantized_cpu
1036
1151
 
1037
1152
  - func: resize_(Tensor(a!) self, int[] size, *, MemoryFormat? memory_format=None) -> Tensor(a!)
1153
+ manual_kernel_registration: True
1038
1154
  supports_named_tensor: True
1039
1155
  variants: method
1040
1156
  device_guard: False
1041
- dispatch:
1042
- CPU: resize_cpu_
1043
- CUDA: resize_cuda_
1044
- QuantizedCPU: quantized_resize_cpu_
1045
1157
 
1046
1158
  - func: empty.out(int[] size, *, MemoryFormat? memory_format=None, Tensor(a!) out) -> Tensor(a!)
1047
1159
  device_guard: False
1048
1160
 
1049
- - func: empty_like(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor
1050
- device_guard: False
1051
- supports_named_tensor: True
1052
-
1053
- - func: empty_like.dtype(Tensor self, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
1161
+ - func: empty_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
1054
1162
  device_guard: False
1055
1163
  supports_named_tensor: True
1056
1164
 
@@ -1192,6 +1300,40 @@
1192
1300
  CPU: floor_out
1193
1301
  CUDA: floor_out
1194
1302
 
1303
+ - func: floor_divide(Tensor self, Tensor other) -> Tensor
1304
+ variants: function, method
1305
+ dispatch:
1306
+ CPU: floor_divide
1307
+ CUDA: floor_divide
1308
+ SparseCPU: floor_divide_sparse
1309
+ SparseCUDA: floor_divide_sparse
1310
+ supports_named_tensor: True
1311
+
1312
+ - func: floor_divide_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
1313
+ variants: method
1314
+ dispatch:
1315
+ CPU: floor_divide_
1316
+ CUDA: floor_divide_
1317
+ SparseCPU: floor_divide_sparse_
1318
+ SparseCUDA: floor_divide_sparse_
1319
+ supports_named_tensor: True
1320
+
1321
+ - func: floor_divide.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
1322
+ dispatch:
1323
+ CPU: floor_divide_out
1324
+ CUDA: floor_divide_out
1325
+ SparseCPU: floor_divide_out_sparse_zerodim
1326
+ SparseCUDA: floor_divide_out_sparse_zerodim
1327
+ supports_named_tensor: True
1328
+
1329
+ - func: floor_divide.Scalar(Tensor self, Scalar other) -> Tensor
1330
+ variants: function, method
1331
+ supports_named_tensor: True
1332
+
1333
+ - func: floor_divide_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
1334
+ variants: method
1335
+ supports_named_tensor: True
1336
+
1195
1337
  - func: frac(Tensor self) -> Tensor
1196
1338
  use_c10_dispatcher: full
1197
1339
  supports_named_tensor: True
@@ -1211,10 +1353,7 @@
1211
1353
 
1212
1354
  - func: full.out(int[] size, Scalar fill_value, *, Tensor(a!) out) -> Tensor(a!)
1213
1355
 
1214
- - func: full_like(Tensor self, Scalar fill_value, *, MemoryFormat? memory_format=None) -> Tensor
1215
- supports_named_tensor: True
1216
-
1217
- - func: full_like.dtype(Tensor self, Scalar fill_value, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
1356
+ - func: full_like(Tensor self, Scalar fill_value, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
1218
1357
  supports_named_tensor: True
1219
1358
 
1220
1359
  - func: from_file(str filename, bool? shared=None, int? size=0, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
@@ -1275,14 +1414,8 @@
1275
1414
  - func: ger(Tensor self, Tensor vec2) -> Tensor
1276
1415
  use_c10_dispatcher: full
1277
1416
  variants: function, method
1278
- dispatch:
1279
- CPU: legacy::cpu::_th_ger
1280
- CUDA: legacy::cuda::_th_ger
1281
1417
 
1282
1418
  - func: ger.out(Tensor self, Tensor vec2, *, Tensor(a!) out) -> Tensor(a!)
1283
- dispatch:
1284
- CPU: legacy::cpu::_th_ger_out
1285
- CUDA: legacy::cuda::_th_ger_out
1286
1419
 
1287
1420
  - func: group_norm(Tensor input, int num_groups, Tensor? weight=None, Tensor? bias=None, float eps=1e-05, bool cudnn_enabled=True) -> Tensor
1288
1421
 
@@ -1324,6 +1457,9 @@
1324
1457
  - func: index.Tensor(Tensor self, Tensor?[] indices) -> Tensor
1325
1458
  variants: function, method
1326
1459
  # NB: This function is special-cased in tools/autograd/gen_variable_type.py
1460
+ # NB: The following functions are declared in aten/src/ATen/templates/TensorBody.h and defined in aten/src/ATen/TensorIndexing.cpp:
1461
+ # - Tensor Tensor::index(ArrayRef<TensorIndex> indices)
1462
+ # - Tensor Tensor::index(std::initializer_list<TensorIndex> indices)
1327
1463
 
1328
1464
  - func: index_copy_(Tensor(a!) self, int dim, Tensor index, Tensor source) -> Tensor(a!)
1329
1465
  variants: method
@@ -1340,6 +1476,11 @@
1340
1476
 
1341
1477
  - func: index_put_(Tensor(a!) self, Tensor?[] indices, Tensor values, bool accumulate=False) -> Tensor(a!)
1342
1478
  variants: function, method
1479
+ # NB: The following functions are declared in aten/src/ATen/templates/TensorBody.h and defined in aten/src/ATen/TensorIndexing.cpp:
1480
+ # - Tensor & Tensor::index_put_(ArrayRef<TensorIndex> indices, Tensor const & rhs)
1481
+ # - Tensor & Tensor::index_put_(ArrayRef<TensorIndex> indices, Scalar v)
1482
+ # - Tensor & Tensor::index_put_(std::initializer_list<TensorIndex> indices, Tensor const & rhs)
1483
+ # - Tensor & Tensor::index_put_(std::initializer_list<TensorIndex> indices, Scalar v)
1343
1484
 
1344
1485
  - func: index_put(Tensor self, Tensor?[] indices, Tensor values, bool accumulate=False) -> Tensor
1345
1486
  variants: function, method
@@ -1372,6 +1513,11 @@
1372
1513
  variants: function
1373
1514
  device_guard: False
1374
1515
  supports_named_tensor: True
1516
+ dispatch:
1517
+ CPU: isnan
1518
+ CUDA: isnan
1519
+ SparseCPU: isnan_sparse
1520
+ SparseCUDA: isnan_sparse
1375
1521
 
1376
1522
  - func: is_distributed(Tensor self) -> bool
1377
1523
  use_c10_dispatcher: full
@@ -1638,10 +1784,13 @@
1638
1784
 
1639
1785
  # Return: (Tensor output, Tensor indices)
1640
1786
  - func: max_pool1d_with_indices(Tensor self, int[1] kernel_size, int[1] stride=[], int[1] padding=0, int[1] dilation=1, bool ceil_mode=False) -> (Tensor, Tensor)
1787
+ supports_named_tensor: True
1641
1788
 
1642
1789
  - func: max_pool1d(Tensor self, int[1] kernel_size, int[1] stride=[], int[1] padding=0, int[1] dilation=1, bool ceil_mode=False) -> Tensor
1790
+ supports_named_tensor: True
1643
1791
 
1644
1792
  - func: max_pool2d(Tensor self, int[2] kernel_size, int[2] stride=[], int[2] padding=0, int[2] dilation=1, bool ceil_mode=False) -> Tensor
1793
+ supports_named_tensor: True
1645
1794
 
1646
1795
  - func: mkldnn_max_pool2d(Tensor self, int[2] kernel_size, int[2] stride=[], int[2] padding=0, int[2] dilation=1, bool ceil_mode=False) -> Tensor
1647
1796
  requires_tensor: True
@@ -1654,6 +1803,7 @@
1654
1803
  QuantizedCPU: quantized_max_pool2d
1655
1804
 
1656
1805
  - func: max_pool3d(Tensor self, int[3] kernel_size, int[3] stride=[], int[3] padding=0, int[3] dilation=1, bool ceil_mode=False) -> Tensor
1806
+ supports_named_tensor: True
1657
1807
 
1658
1808
  # The CPU and GPU dispatch variants are named weirdly here because otherwise there
1659
1809
  # are namespacing issues in C++
@@ -1804,7 +1954,7 @@
1804
1954
  use_c10_dispatcher: full
1805
1955
  variants: function, method
1806
1956
  dispatch:
1807
- CPU: legacy::cpu::_th_mm
1957
+ CPU: mm_cpu
1808
1958
  CUDA: legacy::cuda::_th_mm
1809
1959
  SparseCPU: _sparse_mm
1810
1960
  SparseCUDA: _sparse_mm
@@ -1812,7 +1962,7 @@
1812
1962
 
1813
1963
  - func: mm.out(Tensor self, Tensor mat2, *, Tensor(a!) out) -> Tensor(a!)
1814
1964
  dispatch:
1815
- CPU: legacy::cpu::_th_mm_out
1965
+ CPU: mm_cpu_out
1816
1966
  CUDA: legacy::cuda::_th_mm_out
1817
1967
  SparseCPU: _sparse_mm_out
1818
1968
  SparseCUDA: _sparse_mm_out
@@ -1877,13 +2027,13 @@
1877
2027
  use_c10_dispatcher: full
1878
2028
  variants: function, method
1879
2029
  dispatch:
1880
- CPU: legacy::cpu::_th_mv
2030
+ CPU: mv_cpu
1881
2031
  CUDA: legacy::cuda::_th_mv
1882
2032
  supports_named_tensor: True
1883
2033
 
1884
2034
  - func: mv.out(Tensor self, Tensor vec, *, Tensor(a!) out) -> Tensor(a!)
1885
2035
  dispatch:
1886
- CPU: legacy::cpu::_th_mv_out
2036
+ CPU: mv_cpu_out
1887
2037
  CUDA: legacy::cuda::_th_mv_out
1888
2038
  supports_named_tensor: True
1889
2039
 
@@ -1908,12 +2058,21 @@
1908
2058
  device_guard: False
1909
2059
  supports_named_tensor: True
1910
2060
 
2061
+ - func: narrow.Tensor(Tensor(a) self, int dim, Tensor start, int length) -> Tensor(a)
2062
+ variants: function, method
2063
+ device_guard: False
2064
+ supports_named_tensor: True
2065
+
1911
2066
  - func: native_batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps) -> (Tensor, Tensor, Tensor)
1912
2067
  dispatch:
1913
2068
  CPU: batch_norm_cpu
1914
2069
  CUDA: batch_norm_cuda
1915
2070
  MkldnnCPU: mkldnn_batch_norm
1916
2071
 
2072
+ - func: native_batch_norm.out(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps, *, Tensor(a!) out, Tensor(b!) save_mean, Tensor(c!) save_invstd) -> (Tensor(a!), Tensor(b!), Tensor(c!))
2073
+ dispatch:
2074
+ CUDA: batch_norm_cuda_out
2075
+
1917
2076
  - func: batch_norm_stats(Tensor input, float eps) -> (Tensor, Tensor)
1918
2077
  dispatch:
1919
2078
  CUDA: batch_norm_stats_cuda
@@ -1975,16 +2134,16 @@
1975
2134
 
1976
2135
  - func: ones.out(int[] size, *, Tensor(a!) out) -> Tensor(a!)
1977
2136
 
1978
- - func: ones_like(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor
1979
- supports_named_tensor: True
1980
-
1981
- - func: ones_like.dtype(Tensor self, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
2137
+ - func: ones_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
1982
2138
  supports_named_tensor: True
1983
2139
 
1984
2140
  - func: pairwise_distance(Tensor x1, Tensor x2, float p=2, float eps=1e-06, bool keepdim=False) -> Tensor
1985
2141
  use_c10_dispatcher: full
1986
2142
 
1987
2143
  - func: cdist(Tensor x1, Tensor x2, float p=2, int? compute_mode=None) -> Tensor
2144
+ supports_named_tensor: True
2145
+
2146
+ - func: _cdist_forward(Tensor x1, Tensor x2, float p, int? compute_mode) -> Tensor
1988
2147
  use_c10_dispatcher: full
1989
2148
  supports_named_tensor: True
1990
2149
 
@@ -2053,10 +2212,7 @@
2053
2212
 
2054
2213
  - func: rand.generator_out(int[] size, *, Generator? generator, Tensor(a!) out) -> Tensor(a!)
2055
2214
 
2056
- - func: rand_like(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor
2057
- supports_named_tensor: True
2058
-
2059
- - func: rand_like.dtype(Tensor self, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
2215
+ - func: rand_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
2060
2216
  supports_named_tensor: True
2061
2217
 
2062
2218
  - func: randint(int high, int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
@@ -2075,13 +2231,9 @@
2075
2231
 
2076
2232
  - func: randint.low_generator_out(int low, int high, int[] size, *, Generator? generator, Tensor(a!) out) -> Tensor(a!)
2077
2233
 
2078
- - func: randint_like(Tensor self, int high, *, MemoryFormat? memory_format=None) -> Tensor
2079
-
2080
- - func: randint_like.low(Tensor self, int low, int high, *, MemoryFormat? memory_format=None) -> Tensor
2234
+ - func: randint_like(Tensor self, int high, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
2081
2235
 
2082
- - func: randint_like.dtype(Tensor self, int high, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
2083
-
2084
- - func: randint_like.low_dtype(Tensor self, int low, int high, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
2236
+ - func: randint_like.low_dtype(Tensor self, int low, int high, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
2085
2237
 
2086
2238
  - func: randn(int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
2087
2239
 
@@ -2097,10 +2249,7 @@
2097
2249
 
2098
2250
  - func: randn.generator_out(int[] size, *, Generator? generator, Tensor(a!) out) -> Tensor(a!)
2099
2251
 
2100
- - func: randn_like(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor
2101
- supports_named_tensor: True
2102
-
2103
- - func: randn_like.dtype(Tensor self, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
2252
+ - func: randn_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
2104
2253
  supports_named_tensor: True
2105
2254
 
2106
2255
  - func: randperm(int n, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
@@ -2131,15 +2280,9 @@
2131
2280
  - func: reciprocal_(Tensor(a!) self) -> Tensor(a!)
2132
2281
  supports_named_tensor: True
2133
2282
  variants: function, method
2134
- dispatch:
2135
- CPU: _reciprocal__cpu
2136
- CUDA: _reciprocal__cuda
2137
2283
 
2138
2284
  - func: reciprocal.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
2139
2285
  supports_named_tensor: True
2140
- dispatch:
2141
- CPU: _reciprocal_out_cpu
2142
- CUDA: _reciprocal_out_cuda
2143
2286
 
2144
2287
  - func: neg(Tensor self) -> Tensor
2145
2288
  use_c10_dispatcher: full
@@ -2258,16 +2401,10 @@
2258
2401
  - func: hardshrink(Tensor self, Scalar lambd=0.5) -> Tensor
2259
2402
  use_c10_dispatcher: full
2260
2403
  variants: function, method
2261
- dispatch:
2262
- CPU: hardshrink_cpu
2263
- CUDA: hardshrink_cuda
2264
2404
 
2265
2405
  - func: hardshrink_backward(Tensor grad_out, Tensor self, Scalar lambd) -> Tensor
2266
2406
  use_c10_dispatcher: full
2267
2407
  variants: function, method
2268
- dispatch:
2269
- CPU: hardshrink_backward_cpu
2270
- CUDA: hardshrink_backward_cuda
2271
2408
 
2272
2409
  - func: rsqrt(Tensor self) -> Tensor
2273
2410
  use_c10_dispatcher: full
@@ -2312,6 +2449,7 @@
2312
2449
  dispatch:
2313
2450
  CPU: sigmoid
2314
2451
  CUDA: sigmoid
2452
+ QuantizedCPU: quantized_sigmoid
2315
2453
  MkldnnCPU: mkldnn_sigmoid
2316
2454
 
2317
2455
  - func: sigmoid_(Tensor(a!) self) -> Tensor(a!)
@@ -2365,6 +2503,7 @@
2365
2503
  # be updated.
2366
2504
  - func: detach(Tensor self) -> Tensor
2367
2505
  use_c10_dispatcher: full
2506
+ manual_kernel_registration: True
2368
2507
  supports_named_tensor: True
2369
2508
  variants: function, method
2370
2509
 
@@ -2372,6 +2511,7 @@
2372
2511
  # only be called on non-view `Variable`s. You can use `is_view()` to check
2373
2512
  # this. If this `Variable` is a view, throws an `std::runtime_error()`.
2374
2513
  - func: detach_(Tensor(a!) self) -> Tensor(a!)
2514
+ manual_kernel_registration: True
2375
2515
  supports_named_tensor: True
2376
2516
  variants: function, method
2377
2517
 
@@ -2524,6 +2664,15 @@
2524
2664
  - func: sqrt.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
2525
2665
  supports_named_tensor: True
2526
2666
 
2667
+ - func: square(Tensor self) -> Tensor
2668
+ use_c10_dispatcher: full
2669
+ supports_named_tensor: True
2670
+ variants: function, method
2671
+
2672
+ - func: square_(Tensor(a!) self) -> Tensor(a!)
2673
+ supports_named_tensor: True
2674
+ variants: function, method
2675
+
2527
2676
  - func: std(Tensor self, bool unbiased=True) -> Tensor
2528
2677
  use_c10_dispatcher: full
2529
2678
  variants: function, method
@@ -2605,6 +2754,10 @@
2605
2754
  use_c10_dispatcher: full
2606
2755
  supports_named_tensor: True
2607
2756
  variants: function, method
2757
+ dispatch:
2758
+ CPU: tanh
2759
+ CUDA: tanh
2760
+ QuantizedCPU: quantized_tanh
2608
2761
 
2609
2762
  - func: tanh_(Tensor(a!) self) -> Tensor(a!)
2610
2763
  supports_named_tensor: True
@@ -2627,17 +2780,29 @@
2627
2780
  use_c10_dispatcher: full
2628
2781
  variants: function
2629
2782
  supports_named_tensor: True
2783
+ dispatch:
2784
+ CPU: threshold
2785
+ CUDA: threshold_cuda
2630
2786
 
2631
2787
  - func: threshold_(Tensor(a!) self, Scalar threshold, Scalar value) -> Tensor(a!)
2632
2788
  variants: function
2633
2789
  supports_named_tensor: True
2790
+ dispatch:
2791
+ CPU: threshold_
2792
+ CUDA: threshold__cuda
2634
2793
 
2635
2794
  - func: threshold.out(Tensor self, Scalar threshold, Scalar value, *, Tensor(a!) out) -> Tensor(a!)
2636
2795
  supports_named_tensor: True
2796
+ dispatch:
2797
+ CPU: threshold_out
2798
+ CUDA: threshold_out_cuda
2637
2799
 
2638
2800
  - func: threshold_backward(Tensor grad_output, Tensor self, Scalar threshold) -> Tensor
2639
2801
  use_c10_dispatcher: full
2640
2802
  variants: function
2803
+ dispatch:
2804
+ CPU: threshold_backward
2805
+ CUDA: threshold_backward_cuda
2641
2806
 
2642
2807
  - func: transpose.int(Tensor(a) self, int dim0, int dim1) -> Tensor(a)
2643
2808
  variants: function, method
@@ -2699,6 +2864,42 @@
2699
2864
  - func: triplet_margin_loss(Tensor anchor, Tensor positive, Tensor negative, float margin=1.0, float p=2, float eps=1e-06, bool swap=False, int reduction=Mean) -> Tensor
2700
2865
  use_c10_dispatcher: full
2701
2866
 
2867
+ - func: true_divide.Tensor(Tensor self, Tensor other) -> Tensor
2868
+ use_c10_dispatcher: full
2869
+ variants: function, method
2870
+ dispatch:
2871
+ CPU: true_divide
2872
+ CUDA: true_divide
2873
+ SparseCPU: true_divide_sparse
2874
+ SparseCUDA: true_divide_sparse
2875
+ supports_named_tensor: True
2876
+
2877
+ - func: true_divide_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
2878
+ variants: method
2879
+ dispatch:
2880
+ CPU: true_divide_
2881
+ CUDA: true_divide_
2882
+ SparseCPU: true_divide_sparse_
2883
+ SparseCUDA: true_divide_sparse_
2884
+ supports_named_tensor: True
2885
+
2886
+ - func: true_divide.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
2887
+ dispatch:
2888
+ CPU: true_divide_out
2889
+ CUDA: true_divide_out
2890
+ SparseCPU: true_divide_out_sparse_zerodim
2891
+ SparseCUDA: true_divide_out_sparse_zerodim
2892
+ supports_named_tensor: True
2893
+
2894
+ - func: true_divide.Scalar(Tensor self, Scalar other) -> Tensor
2895
+ use_c10_dispatcher: full
2896
+ variants: function, method
2897
+ supports_named_tensor: True
2898
+
2899
+ - func: true_divide_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
2900
+ variants: method
2901
+ supports_named_tensor: True
2902
+
2702
2903
  - func: trunc(Tensor self) -> Tensor
2703
2904
  use_c10_dispatcher: full
2704
2905
  supports_named_tensor: True
@@ -2815,9 +3016,6 @@
2815
3016
  - func: _s_where(Tensor condition, Tensor self, Tensor other) -> Tensor
2816
3017
  use_c10_dispatcher: full
2817
3018
  variants: function
2818
- dispatch:
2819
- CPU: _s_where_cpu
2820
- CUDA: _s_where_cuda
2821
3019
 
2822
3020
  - func: norm_except_dim(Tensor v, int pow=2, int dim=0) -> Tensor
2823
3021
  variants: function
@@ -2848,10 +3046,7 @@
2848
3046
 
2849
3047
  - func: zeros.out(int[] size, *, Tensor(a!) out) -> Tensor(a!)
2850
3048
 
2851
- - func: zeros_like(Tensor self, *, MemoryFormat? memory_format=None) -> Tensor
2852
- supports_named_tensor: True
2853
-
2854
- - func: zeros_like.dtype(Tensor self, *, ScalarType dtype, Layout layout, Device device, bool pin_memory=False, MemoryFormat? memory_format=None) -> Tensor
3049
+ - func: zeros_like(Tensor self, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor
2855
3050
  supports_named_tensor: True
2856
3051
 
2857
3052
  - func: _standard_gamma_grad(Tensor self, Tensor output) -> Tensor
@@ -2970,6 +3165,7 @@
2970
3165
  supports_named_tensor: True
2971
3166
 
2972
3167
  - func: resize_as_(Tensor(a!) self, Tensor the_template, *, MemoryFormat? memory_format=None) -> Tensor(a!)
3168
+ manual_kernel_registration: True
2973
3169
  supports_named_tensor: True
2974
3170
  variants: function, method
2975
3171
 
@@ -3489,6 +3685,7 @@
3489
3685
  CPU: make_per_channel_quantized_tensor_cpu
3490
3686
 
3491
3687
  - func: qscheme(Tensor self) -> QScheme
3688
+ use_c10_dispatcher: full
3492
3689
  variants: method
3493
3690
  dispatch:
3494
3691
  QuantizedCPU: qscheme_quant
@@ -3496,28 +3693,19 @@
3496
3693
  - func: fake_quantize_per_tensor_affine(Tensor self, float scale, int zero_point, int quant_min, int quant_max) -> Tensor
3497
3694
  use_c10_dispatcher: full
3498
3695
  variants: function
3499
- dispatch:
3500
- CPU: fake_quantize_per_tensor_affine_cpu
3501
- CUDA: fake_quantize_per_tensor_affine_cuda
3502
3696
 
3503
3697
  - func: fake_quantize_per_tensor_affine_backward(Tensor grad, Tensor self, float scale, int zero_point, int quant_min, int quant_max) -> Tensor
3504
3698
  use_c10_dispatcher: full
3505
3699
  variants: function
3506
- dispatch:
3507
- CPU: fake_quantize_per_tensor_affine_backward_cpu
3508
- CUDA: fake_quantize_per_tensor_affine_backward_cuda
3509
3700
 
3510
3701
  - func: fake_quantize_per_channel_affine(Tensor self, Tensor scale, Tensor zero_point, int axis, int quant_min, int quant_max) -> Tensor
3702
+ use_c10_dispatcher: full
3511
3703
  variants: function
3512
- dispatch:
3513
- CPU: fake_quantize_per_channel_affine_cpu
3514
- CUDA: fake_quantize_per_channel_affine_cuda
3515
3704
 
3516
3705
  - func: fake_quantize_per_channel_affine_backward(Tensor grad, Tensor self, Tensor scale, Tensor zero_point, int axis, int quant_min, int quant_max) -> Tensor
3706
+ use_c10_dispatcher: full
3517
3707
  variants: function
3518
- dispatch:
3519
- CPU: fake_quantize_per_channel_affine_backward_cpu
3520
- CUDA: fake_quantize_per_channel_affine_backward_cuda
3708
+
3521
3709
  # to(Device) must not exist because all constructors of Device also works for
3522
3710
  # TensorOptions. Otherwise, an ambiguity error is thrown.
3523
3711
  # See NOTE [ TensorOptions Constructors ].
@@ -3677,8 +3865,8 @@
3677
3865
  variants: method
3678
3866
  device_guard: False
3679
3867
  dispatch:
3680
- CPU: legacy::cpu::_th_set_
3681
- CUDA: legacy::cuda::_th_set_
3868
+ CPU: set_tensor_
3869
+ CUDA: set_tensor_
3682
3870
 
3683
3871
  - func: set_(Tensor(a!) self) -> Tensor(a!)
3684
3872
  variants: method
@@ -3752,7 +3940,7 @@
3752
3940
  variants: method
3753
3941
  dispatch:
3754
3942
  CPU: index_add_cpu_
3755
- CUDA: legacy::cuda::_th_index_add_
3943
+ CUDA: index_add_cuda_
3756
3944
 
3757
3945
  - func: index_add(Tensor self, int dim, Tensor index, Tensor source) -> Tensor
3758
3946
  use_c10_dispatcher: full
@@ -3804,7 +3992,7 @@
3804
3992
  - func: scatter_.src(Tensor(a!) self, int dim, Tensor index, Tensor src) -> Tensor(a!)
3805
3993
  variants: method
3806
3994
  dispatch:
3807
- CPU: legacy::cpu::_th_scatter_
3995
+ CPU: scatter_cpu_
3808
3996
  CUDA: legacy::cuda::_th_scatter_
3809
3997
 
3810
3998
  - func: scatter.src(Tensor self, int dim, Tensor index, Tensor src) -> Tensor
@@ -3814,7 +4002,7 @@
3814
4002
  - func: scatter_.value(Tensor(a!) self, int dim, Tensor index, Scalar value) -> Tensor(a!)
3815
4003
  variants: method
3816
4004
  dispatch:
3817
- CPU: legacy::cpu::_th_scatter_
4005
+ CPU: scatter_fill_cpu_
3818
4006
  CUDA: legacy::cuda::_th_scatter_
3819
4007
 
3820
4008
  - func: scatter.value(Tensor self, int dim, Tensor index, Scalar value) -> Tensor
@@ -3830,7 +4018,7 @@
3830
4018
  - func: scatter_add_(Tensor(a!) self, int dim, Tensor index, Tensor src) -> Tensor(a!)
3831
4019
  variants: method
3832
4020
  dispatch:
3833
- CPU: legacy::cpu::_th_scatter_add_
4021
+ CPU: scatter_add_cpu_
3834
4022
  CUDA: legacy::cuda::_th_scatter_add_
3835
4023
 
3836
4024
  - func: scatter_add(Tensor self, int dim, Tensor index, Tensor src) -> Tensor
@@ -3876,57 +4064,81 @@
3876
4064
  - func: ne_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
3877
4065
  variants: method
3878
4066
 
4067
+ - func: bitwise_and.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4068
+ variants: function
4069
+ dispatch:
4070
+ CPU: bitwise_and_out
4071
+ CUDA: bitwise_and_out
4072
+
4073
+ - func: bitwise_and.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)
4074
+ variants: function
4075
+ dispatch:
4076
+ CPU: bitwise_and_out
4077
+ CUDA: bitwise_and_out
4078
+
4079
+ - func: bitwise_and.Scalar(Tensor self, Scalar other) -> Tensor
4080
+ variants: method, function
4081
+
4082
+ - func: bitwise_and.Tensor(Tensor self, Tensor other) -> Tensor
4083
+ variants: method, function
4084
+
4085
+ - func: bitwise_and_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
4086
+ variants: method
4087
+
4088
+ - func: bitwise_and_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
4089
+ variants: method
4090
+
3879
4091
  - func: __and__.Scalar(Tensor self, Scalar other) -> Tensor
3880
4092
  use_c10_dispatcher: full
3881
4093
  variants: method, function
3882
- dispatch:
3883
- CPU: legacy::cpu::_th_and
3884
- CUDA: legacy::cuda::_th_and
3885
4094
 
3886
4095
  - func: __and__.Tensor(Tensor self, Tensor other) -> Tensor
3887
4096
  use_c10_dispatcher: full
3888
4097
  variants: method, function
3889
- dispatch:
3890
- CPU: legacy::cpu::_th_and
3891
- CUDA: legacy::cuda::_th_and
3892
4098
 
3893
4099
  - func: __iand__.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
3894
4100
  variants: method
3895
- dispatch:
3896
- CPU: legacy::cpu::_th_iand_
3897
- CUDA: legacy::cuda::_th_iand_
3898
4101
 
3899
4102
  - func: __iand__.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
3900
4103
  variants: method
4104
+
4105
+ - func: bitwise_or.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4106
+ variants: function
4107
+ dispatch:
4108
+ CPU: bitwise_or_out
4109
+ CUDA: bitwise_or_out
4110
+
4111
+ - func: bitwise_or.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)
4112
+ variants: function
3901
4113
  dispatch:
3902
- CPU: legacy::cpu::_th_iand_
3903
- CUDA: legacy::cuda::_th_iand_
4114
+ CPU: bitwise_or_out
4115
+ CUDA: bitwise_or_out
4116
+
4117
+ - func: bitwise_or.Scalar(Tensor self, Scalar other) -> Tensor
4118
+ variants: method, function
4119
+
4120
+ - func: bitwise_or.Tensor(Tensor self, Tensor other) -> Tensor
4121
+ variants: method, function
4122
+
4123
+ - func: bitwise_or_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
4124
+ variants: method
4125
+
4126
+ - func: bitwise_or_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
4127
+ variants: method
3904
4128
 
3905
4129
  - func: __or__.Scalar(Tensor self, Scalar other) -> Tensor
3906
4130
  use_c10_dispatcher: full
3907
4131
  variants: method, function
3908
- dispatch:
3909
- CPU: legacy::cpu::_th_or
3910
- CUDA: legacy::cuda::_th_or
3911
4132
 
3912
4133
  - func: __or__.Tensor(Tensor self, Tensor other) -> Tensor
3913
4134
  use_c10_dispatcher: full
3914
4135
  variants: method, function
3915
- dispatch:
3916
- CPU: legacy::cpu::_th_or
3917
- CUDA: legacy::cuda::_th_or
3918
4136
 
3919
4137
  - func: __ior__.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
3920
4138
  variants: method
3921
- dispatch:
3922
- CPU: legacy::cpu::_th_ior_
3923
- CUDA: legacy::cuda::_th_ior_
3924
4139
 
3925
4140
  - func: __ior__.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
3926
4141
  variants: method
3927
- dispatch:
3928
- CPU: legacy::cpu::_th_ior_
3929
- CUDA: legacy::cuda::_th_ior_
3930
4142
 
3931
4143
  - func: bitwise_xor.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
3932
4144
  variants: function
@@ -3970,53 +4182,53 @@
3970
4182
  use_c10_dispatcher: full
3971
4183
  variants: method, function
3972
4184
  dispatch:
3973
- CPU: legacy::cpu::_th_lshift
3974
- CUDA: legacy::cuda::_th_lshift
4185
+ CPU: __lshift__
4186
+ CUDA: __lshift__
3975
4187
 
3976
4188
  - func: __lshift__.Tensor(Tensor self, Tensor other) -> Tensor
3977
4189
  use_c10_dispatcher: full
3978
4190
  variants: method, function
3979
4191
  dispatch:
3980
- CPU: legacy::cpu::_th_lshift
3981
- CUDA: legacy::cuda::_th_lshift
4192
+ CPU: __lshift__
4193
+ CUDA: __lshift__
3982
4194
 
3983
4195
  - func: __ilshift__.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
3984
4196
  variants: method
3985
4197
  dispatch:
3986
- CPU: legacy::cpu::_th_ilshift_
3987
- CUDA: legacy::cuda::_th_ilshift_
4198
+ CPU: __ilshift__
4199
+ CUDA: __ilshift__
3988
4200
 
3989
4201
  - func: __ilshift__.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
3990
4202
  variants: method
3991
4203
  dispatch:
3992
- CPU: legacy::cpu::_th_ilshift_
3993
- CUDA: legacy::cuda::_th_ilshift_
4204
+ CPU: __ilshift__
4205
+ CUDA: __ilshift__
3994
4206
 
3995
4207
  - func: __rshift__.Scalar(Tensor self, Scalar other) -> Tensor
3996
4208
  use_c10_dispatcher: full
3997
4209
  variants: method, function
3998
4210
  dispatch:
3999
- CPU: legacy::cpu::_th_rshift
4000
- CUDA: legacy::cuda::_th_rshift
4211
+ CPU: __rshift__
4212
+ CUDA: __rshift__
4001
4213
 
4002
4214
  - func: __rshift__.Tensor(Tensor self, Tensor other) -> Tensor
4003
4215
  use_c10_dispatcher: full
4004
4216
  variants: method, function
4005
4217
  dispatch:
4006
- CPU: legacy::cpu::_th_rshift
4007
- CUDA: legacy::cuda::_th_rshift
4218
+ CPU: __rshift__
4219
+ CUDA: __rshift__
4008
4220
 
4009
4221
  - func: __irshift__.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
4010
4222
  variants: method
4011
4223
  dispatch:
4012
- CPU: legacy::cpu::_th_irshift_
4013
- CUDA: legacy::cuda::_th_irshift_
4224
+ CPU: __irshift__
4225
+ CUDA: __irshift__
4014
4226
 
4015
4227
  - func: __irshift__.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
4016
4228
  variants: method
4017
4229
  dispatch:
4018
- CPU: legacy::cpu::_th_irshift_
4019
- CUDA: legacy::cuda::_th_irshift_
4230
+ CPU: __irshift__
4231
+ CUDA: __irshift__
4020
4232
 
4021
4233
  - func: lgamma_(Tensor(a!) self) -> Tensor(a!)
4022
4234
  supports_named_tensor: True
@@ -4084,26 +4296,26 @@
4084
4296
  - func: fmod_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
4085
4297
  variants: method
4086
4298
  dispatch:
4087
- CPU: legacy::cpu::_th_fmod_
4299
+ CPU: fmod_
4088
4300
  CUDA: legacy::cuda::_th_fmod_
4089
4301
 
4090
4302
  - func: fmod_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
4091
4303
  variants: method
4092
4304
  dispatch:
4093
- CPU: legacy::cpu::_th_fmod_
4305
+ CPU: fmod_
4094
4306
  CUDA: legacy::cuda::_th_fmod_
4095
4307
 
4096
4308
  - func: remainder_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
4097
4309
  variants: method
4098
4310
  dispatch:
4099
- CPU: legacy::cpu::_th_remainder_
4100
- CUDA: legacy::cuda::_th_remainder_
4311
+ CPU: remainder_
4312
+ CUDA: remainder_
4101
4313
 
4102
4314
  - func: remainder_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
4103
4315
  variants: method
4104
4316
  dispatch:
4105
- CPU: legacy::cpu::_th_remainder_
4106
- CUDA: legacy::cuda::_th_remainder_
4317
+ CPU: remainder_
4318
+ CUDA: remainder_
4107
4319
 
4108
4320
  - func: addbmm_(Tensor(a!) self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
4109
4321
  variants: method
@@ -4127,25 +4339,16 @@
4127
4339
  variants: method
4128
4340
  supports_named_tensor: True
4129
4341
 
4130
- - func: random_.from(Tensor(a!) self, int from, int to, *, Generator? generator=None) -> Tensor(a!)
4342
+ - func: random_.from(Tensor(a!) self, int from, int? to, *, Generator? generator=None) -> Tensor(a!)
4131
4343
  variants: method
4132
- dispatch:
4133
- CPU: legacy::cpu::_th_random_
4134
- CUDA: clamped_random_cuda_
4135
4344
  supports_named_tensor: True
4136
4345
 
4137
4346
  - func: random_.to(Tensor(a!) self, int to, *, Generator? generator=None) -> Tensor(a!)
4138
4347
  variants: method
4139
- dispatch:
4140
- CPU: legacy::cpu::_th_random_
4141
- CUDA: capped_random_cuda_
4142
4348
  supports_named_tensor: True
4143
4349
 
4144
4350
  - func: random_(Tensor(a!) self, *, Generator? generator=None) -> Tensor(a!)
4145
4351
  variants: method
4146
- dispatch:
4147
- CPU: legacy::cpu::_th_random_
4148
- CUDA: random_cuda_
4149
4352
  supports_named_tensor: True
4150
4353
 
4151
4354
  - func: uniform_(Tensor(a!) self, float from=0, float to=1, *, Generator? generator=None) -> Tensor(a!)
@@ -4155,39 +4358,20 @@
4155
4358
  CUDA: uniform_cuda_
4156
4359
  supports_named_tensor: True
4157
4360
 
4158
- - func: normal_(Tensor(a!) self, float mean=0, float std=1, *, Generator? generator=None) -> Tensor(a!)
4159
- variants: method
4160
- dispatch:
4161
- CPU: legacy::cpu::_th_normal_
4162
- CUDA: normal_cuda_
4163
- supports_named_tensor: True
4164
-
4165
4361
  - func: cauchy_(Tensor(a!) self, float median=0, float sigma=1, *, Generator? generator=None) -> Tensor(a!)
4166
4362
  variants: method
4167
- dispatch:
4168
- CPU: legacy::cpu::_th_cauchy_
4169
- CUDA: cauchy_cuda_
4170
4363
  supports_named_tensor: True
4171
4364
 
4172
4365
  - func: log_normal_(Tensor(a!) self, float mean=1, float std=2, *, Generator? generator=None) -> Tensor(a!)
4173
4366
  variants: method
4174
- dispatch:
4175
- CPU: legacy::cpu::_th_log_normal_
4176
- CUDA: log_normal_cuda_
4177
4367
  supports_named_tensor: True
4178
4368
 
4179
4369
  - func: exponential_(Tensor(a!) self, float lambd=1, *, Generator? generator=None) -> Tensor(a!)
4180
4370
  variants: method
4181
- dispatch:
4182
- CPU: legacy::cpu::_th_exponential_
4183
- CUDA: exponential_cuda_
4184
4371
  supports_named_tensor: True
4185
4372
 
4186
4373
  - func: geometric_(Tensor(a!) self, float p, *, Generator? generator=None) -> Tensor(a!)
4187
4374
  variants: method
4188
- dispatch:
4189
- CPU: legacy::cpu::_th_geometric_
4190
- CUDA: geometric_cuda_
4191
4375
  supports_named_tensor: True
4192
4376
 
4193
4377
  # wrappers for TH functions
@@ -4451,14 +4635,14 @@
4451
4635
 
4452
4636
  - func: index_select.out(Tensor self, int dim, Tensor index, *, Tensor(a!) out) -> Tensor(a!)
4453
4637
  dispatch:
4454
- CPU: legacy::cpu::_th_index_select_out
4638
+ CPU: index_select_out_cpu_
4455
4639
  CUDA: legacy::cuda::_th_index_select_out
4456
4640
 
4457
4641
  - func: index_select(Tensor self, int dim, Tensor index) -> Tensor
4458
4642
  use_c10_dispatcher: full
4459
4643
  variants: method, function
4460
4644
  dispatch:
4461
- CPU: legacy::cpu::_th_index_select
4645
+ CPU: index_select_cpu_
4462
4646
  CUDA: legacy::cuda::_th_index_select
4463
4647
  SparseCPU: index_select_sparse
4464
4648
  SparseCUDA: index_select_sparse
@@ -4794,9 +4978,6 @@
4794
4978
  - func: dist(Tensor self, Tensor other, Scalar p=2) -> Tensor
4795
4979
  use_c10_dispatcher: full
4796
4980
  variants: method, function
4797
- dispatch:
4798
- CPU: legacy::cpu::_th_dist
4799
- CUDA: legacy::cuda::_th_dist
4800
4981
 
4801
4982
  - func: atan2.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4802
4983
  supports_named_tensor: True
@@ -4844,90 +5025,78 @@
4844
5025
 
4845
5026
  - func: fmod.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)
4846
5027
  dispatch:
4847
- CPU: legacy::cpu::_th_fmod_out
5028
+ CPU: fmod_out
4848
5029
  CUDA: legacy::cuda::_th_fmod_out
4849
5030
 
4850
5031
  - func: fmod.Scalar(Tensor self, Scalar other) -> Tensor
4851
5032
  use_c10_dispatcher: full
4852
5033
  variants: method, function
4853
5034
  dispatch:
4854
- CPU: legacy::cpu::_th_fmod
5035
+ CPU: fmod
4855
5036
  CUDA: legacy::cuda::_th_fmod
4856
5037
 
4857
5038
  - func: fmod.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4858
5039
  dispatch:
4859
- CPU: legacy::cpu::_th_fmod_out
5040
+ CPU: fmod_out
4860
5041
  CUDA: legacy::cuda::_th_fmod_out
4861
5042
 
4862
5043
  - func: fmod.Tensor(Tensor self, Tensor other) -> Tensor
4863
5044
  use_c10_dispatcher: full
4864
5045
  variants: method, function
4865
5046
  dispatch:
4866
- CPU: legacy::cpu::_th_fmod
5047
+ CPU: fmod
4867
5048
  CUDA: legacy::cuda::_th_fmod
4868
5049
 
4869
5050
  - func: remainder.Scalar_out(Tensor self, Scalar other, *, Tensor(a!) out) -> Tensor(a!)
4870
5051
  dispatch:
4871
- CPU: legacy::cpu::_th_remainder_out
4872
- CUDA: legacy::cuda::_th_remainder_out
5052
+ CPU: remainder_out
5053
+ CUDA: remainder_out
4873
5054
 
4874
5055
  - func: remainder.Scalar(Tensor self, Scalar other) -> Tensor
4875
5056
  use_c10_dispatcher: full
4876
5057
  variants: method, function
4877
5058
  dispatch:
4878
- CPU: legacy::cpu::_th_remainder
4879
- CUDA: legacy::cuda::_th_remainder
5059
+ CPU: remainder
5060
+ CUDA: remainder
4880
5061
 
4881
5062
  - func: remainder.Tensor_out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4882
5063
  dispatch:
4883
- CPU: legacy::cpu::_th_remainder_out
4884
- CUDA: legacy::cuda::_th_remainder_out
5064
+ CPU: remainder_out
5065
+ CUDA: remainder_out
4885
5066
 
4886
5067
  - func: remainder.Tensor(Tensor self, Tensor other) -> Tensor
4887
5068
  use_c10_dispatcher: full
4888
5069
  variants: method, function
4889
5070
  dispatch:
4890
- CPU: legacy::cpu::_th_remainder
4891
- CUDA: legacy::cuda::_th_remainder
5071
+ CPU: remainder
5072
+ CUDA: remainder
4892
5073
 
4893
5074
  - func: min.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4894
- dispatch:
4895
- CPU: legacy::cpu::_th_min_out
4896
- CUDA: legacy::cuda::_th_min_out
4897
5075
 
4898
5076
  - func: min.other(Tensor self, Tensor other) -> Tensor
4899
5077
  use_c10_dispatcher: full
4900
5078
  variants: method, function
4901
- dispatch:
4902
- CPU: legacy::cpu::_th_min
4903
- CUDA: legacy::cuda::_th_min
4904
5079
 
4905
5080
  - func: min(Tensor self) -> Tensor
4906
5081
  use_c10_dispatcher: full
4907
5082
  variants: method, function
4908
5083
  dispatch:
4909
- CPU: legacy::cpu::_th_min
5084
+ CPU: min
4910
5085
  CUDA: legacy::cuda::_th_min
4911
5086
  QuantizedCPU: min_quant
4912
5087
  supports_named_tensor: True
4913
5088
 
4914
5089
  - func: max.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
4915
- dispatch:
4916
- CPU: legacy::cpu::_th_max_out
4917
- CUDA: legacy::cuda::_th_max_out
4918
5090
 
4919
5091
  - func: max.other(Tensor self, Tensor other) -> Tensor
4920
5092
  use_c10_dispatcher: full
4921
5093
  variants: method, function
4922
- dispatch:
4923
- CPU: legacy::cpu::_th_max
4924
- CUDA: legacy::cuda::_th_max
4925
5094
 
4926
5095
  - func: max(Tensor self) -> Tensor
4927
5096
  use_c10_dispatcher: full
4928
5097
  variants: method, function
4929
5098
  dispatch:
4930
- CPU: legacy::cpu::_th_max
5099
+ CPU: max
4931
5100
  CUDA: legacy::cuda::_th_max
4932
5101
  QuantizedCPU: max_quant
4933
5102
  supports_named_tensor: True
@@ -4985,6 +5154,11 @@
4985
5154
  use_c10_dispatcher: full
4986
5155
  supports_named_tensor: True
4987
5156
  variants: method, function
5157
+ dispatch:
5158
+ CPU: any
5159
+ CUDA: any
5160
+ SparseCPU: any_sparse
5161
+ SparseCUDA: any_sparse
4988
5162
 
4989
5163
  - func: renorm.out(Tensor self, Scalar p, int dim, Scalar maxnorm, *, Tensor(a!) out) -> Tensor(a!)
4990
5164
  dispatch:
@@ -5041,34 +5215,41 @@
5041
5215
  CPU: pow
5042
5216
  CUDA: pow
5043
5217
 
5218
+ - func: normal_(Tensor(a!) self, float mean=0, float std=1, *, Generator? generator=None) -> Tensor(a!)
5219
+ variants: method
5220
+ dispatch:
5221
+ CPU: normal_cpu_
5222
+ CUDA: normal_cuda_
5223
+ supports_named_tensor: True
5224
+
5044
5225
  - func: normal.Tensor_float_out(Tensor mean, float std=1, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)
5045
5226
  dispatch:
5046
- CPU: legacy::cpu::_th_normal_out
5227
+ CPU: normal_out_cpu
5047
5228
  CUDA: normal_out_cuda
5048
5229
 
5049
5230
  - func: normal.Tensor_float(Tensor mean, float std=1, *, Generator? generator=None) -> Tensor
5050
5231
  dispatch:
5051
- CPU: legacy::cpu::_th_normal
5232
+ CPU: normal_cpu
5052
5233
  CUDA: normal_cuda
5053
5234
 
5054
5235
  - func: normal.float_Tensor_out(float mean, Tensor std, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)
5055
5236
  dispatch:
5056
- CPU: legacy::cpu::_th_normal_out
5237
+ CPU: normal_out_cpu
5057
5238
  CUDA: normal_out_cuda
5058
5239
 
5059
5240
  - func: normal.float_Tensor(float mean, Tensor std, *, Generator? generator=None) -> Tensor
5060
5241
  dispatch:
5061
- CPU: legacy::cpu::_th_normal
5242
+ CPU: normal_cpu
5062
5243
  CUDA: normal_cuda
5063
5244
 
5064
5245
  - func: normal.Tensor_Tensor_out(Tensor mean, Tensor std, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)
5065
5246
  dispatch:
5066
- CPU: legacy::cpu::_th_normal_out
5247
+ CPU: normal_out_cpu
5067
5248
  CUDA: normal_out_cuda
5068
5249
 
5069
5250
  - func: normal.Tensor_Tensor(Tensor mean, Tensor std, *, Generator? generator=None) -> Tensor
5070
5251
  dispatch:
5071
- CPU: legacy::cpu::_th_normal
5252
+ CPU: normal_cpu
5072
5253
  CUDA: normal_cuda
5073
5254
 
5074
5255
  - func: normal.float_float(float mean, float std, int[] size, *, Generator? generator=None, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
@@ -5103,23 +5284,23 @@
5103
5284
  - func: _cumsum(Tensor self, int dim) -> Tensor
5104
5285
  use_c10_dispatcher: full
5105
5286
  dispatch:
5106
- CPU: legacy::cpu::_th_cumsum
5287
+ CPU: _cumsum_cpu
5107
5288
  CUDA: legacy::cuda::_th_cumsum
5108
5289
 
5109
5290
  - func: _cumsum.out(Tensor self, int dim, *, Tensor(a!) out) -> Tensor(a!)
5110
5291
  dispatch:
5111
- CPU: legacy::cpu::_th_cumsum_out
5292
+ CPU: _cumsum_out_cpu
5112
5293
  CUDA: legacy::cuda::_th_cumsum_out
5113
5294
 
5114
5295
  - func: _cumprod(Tensor self, int dim) -> Tensor
5115
5296
  use_c10_dispatcher: full
5116
5297
  dispatch:
5117
- CPU: legacy::cpu::_th_cumprod
5298
+ CPU: _cumprod_cpu
5118
5299
  CUDA: legacy::cuda::_th_cumprod
5119
5300
 
5120
5301
  - func: _cumprod.out(Tensor self, int dim, *, Tensor(a!) out) -> Tensor(a!)
5121
5302
  dispatch:
5122
- CPU: legacy::cpu::_th_cumprod_out
5303
+ CPU: _cumprod_out_cpu
5123
5304
  CUDA: legacy::cuda::_th_cumprod_out
5124
5305
 
5125
5306
  - func: _var(Tensor self, bool unbiased=True) -> Tensor
@@ -5136,15 +5317,27 @@
5136
5317
  CUDA: legacy::cuda::_th_std
5137
5318
  supports_named_tensor: True
5138
5319
 
5320
+ - func: _amp_non_finite_check_and_unscale_(Tensor(a!) self, Tensor(b!) found_inf, Tensor inv_scale) -> ()
5321
+ variants: function
5322
+ dispatch:
5323
+ CUDA: _amp_non_finite_check_and_unscale_cuda_
5324
+
5325
+ - func: _amp_update_scale(Tensor(a!) growth_tracker, Tensor current_scale, Tensor found_inf, float scale_growth_factor, float scale_backoff_factor, int growth_interval) -> Tensor
5326
+ variants: function
5327
+ dispatch:
5328
+ CUDA: _amp_update_scale_cuda
5329
+
5139
5330
  - func: _cat(Tensor[] tensors, int dim=0) -> Tensor
5140
5331
  dispatch:
5141
- CPU: legacy::cpu::_th_cat
5142
- CUDA: legacy::cuda::_th_cat
5332
+ CPU: _cat_cpu
5333
+ CUDA: cat_cuda
5334
+ QuantizedCPU: quantized_cat
5143
5335
 
5144
5336
  - func: _cat.out(Tensor[] tensors, int dim=0, *, Tensor(a!) out) -> Tensor(a!)
5145
5337
  dispatch:
5146
- CPU: legacy::cpu::_th_cat_out
5147
- CUDA: legacy::cuda::_th_cat_out
5338
+ CPU: _cat_out_cpu
5339
+ CUDA: cat_out_cuda
5340
+ QuantizedCPU: quantized_cat_out
5148
5341
 
5149
5342
  - func: _mode(Tensor self, int dim=-1, bool keepdim=False) -> (Tensor, Tensor)
5150
5343
  dispatch:
@@ -5178,30 +5371,6 @@
5178
5371
 
5179
5372
  ## NN wrappers
5180
5373
 
5181
- - func: binary_cross_entropy.out(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!)
5182
- python_module: nn
5183
- dispatch:
5184
- CPU: legacy::cpu::_thnn_binary_cross_entropy_forward_out
5185
- CUDA: legacy::cuda::_thnn_binary_cross_entropy_forward_out
5186
-
5187
- - func: binary_cross_entropy(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
5188
- python_module: nn
5189
- dispatch:
5190
- CPU: legacy::cpu::_thnn_binary_cross_entropy_forward
5191
- CUDA: legacy::cuda::_thnn_binary_cross_entropy_forward
5192
-
5193
- - func: binary_cross_entropy_backward.grad_input(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean, *, Tensor(a!) grad_input) -> Tensor(a!)
5194
- python_module: nn
5195
- dispatch:
5196
- CPU: legacy::cpu::_thnn_binary_cross_entropy_backward_out
5197
- CUDA: legacy::cuda::_thnn_binary_cross_entropy_backward_out
5198
-
5199
- - func: binary_cross_entropy_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
5200
- python_module: nn
5201
- dispatch:
5202
- CPU: legacy::cpu::_thnn_binary_cross_entropy_backward
5203
- CUDA: legacy::cuda::_thnn_binary_cross_entropy_backward
5204
-
5205
5374
  - func: mse_loss.out(Tensor self, Tensor target, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!)
5206
5375
  python_module: nn
5207
5376
 
@@ -5377,151 +5546,147 @@
5377
5546
 
5378
5547
  - func: soft_margin_loss.out(Tensor self, Tensor target, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!)
5379
5548
  python_module: nn
5380
- dispatch:
5381
- CPU: legacy::cpu::_thnn_soft_margin_loss_forward_out
5382
- CUDA: legacy::cuda::_thnn_soft_margin_loss_forward_out
5383
5549
 
5384
5550
  - func: soft_margin_loss(Tensor self, Tensor target, int reduction=Mean) -> Tensor
5385
5551
  use_c10_dispatcher: full
5386
5552
  python_module: nn
5387
- dispatch:
5388
- CPU: legacy::cpu::_thnn_soft_margin_loss_forward
5389
- CUDA: legacy::cuda::_thnn_soft_margin_loss_forward
5390
5553
 
5391
5554
  - func: soft_margin_loss_backward.grad_input(Tensor grad_output, Tensor self, Tensor target, int reduction, *, Tensor(a!) grad_input) -> Tensor(a!)
5392
5555
  python_module: nn
5393
- dispatch:
5394
- CPU: legacy::cpu::_thnn_soft_margin_loss_backward_out
5395
- CUDA: legacy::cuda::_thnn_soft_margin_loss_backward_out
5396
5556
 
5397
5557
  - func: soft_margin_loss_backward(Tensor grad_output, Tensor self, Tensor target, int reduction) -> Tensor
5398
5558
  use_c10_dispatcher: full
5399
5559
  python_module: nn
5400
- dispatch:
5401
- CPU: legacy::cpu::_thnn_soft_margin_loss_backward
5402
- CUDA: legacy::cuda::_thnn_soft_margin_loss_backward
5403
5560
 
5404
5561
  - func: elu.out(Tensor self, Scalar alpha=1, Scalar scale=1, Scalar input_scale=1, *, Tensor(a!) out) -> Tensor(a!)
5405
5562
  python_module: nn
5406
5563
  dispatch:
5407
- CPU: legacy::cpu::_thnn_elu_forward_out
5408
- CUDA: legacy::cuda::_thnn_elu_forward_out
5564
+ CPU: elu_out
5565
+ CUDA: elu_out
5566
+ QuantizedCPU: quantized_elu_out
5409
5567
 
5410
5568
  - func: elu(Tensor self, Scalar alpha=1, Scalar scale=1, Scalar input_scale=1) -> Tensor
5411
5569
  use_c10_dispatcher: full
5412
5570
  python_module: nn
5413
5571
  dispatch:
5414
- CPU: legacy::cpu::_thnn_elu_forward
5415
- CUDA: legacy::cuda::_thnn_elu_forward
5572
+ CPU: elu
5573
+ CUDA: elu
5574
+ QuantizedCPU: quantized_elu
5416
5575
 
5417
5576
  - func: elu_backward.grad_input(Tensor grad_output, Scalar alpha, Scalar scale, Scalar input_scale, Tensor output, *, Tensor(a!) grad_input) -> Tensor(a!)
5418
5577
  python_module: nn
5419
5578
  dispatch:
5420
- CPU: legacy::cpu::_thnn_elu_backward_out
5421
- CUDA: legacy::cuda::_thnn_elu_backward_out
5579
+ CPU: elu_backward_out
5580
+ CUDA: elu_backward_out
5422
5581
 
5423
5582
  - func: elu_backward(Tensor grad_output, Scalar alpha, Scalar scale, Scalar input_scale, Tensor output) -> Tensor
5424
5583
  use_c10_dispatcher: full
5425
5584
  python_module: nn
5426
- dispatch:
5427
- CPU: legacy::cpu::_thnn_elu_backward
5428
- CUDA: legacy::cuda::_thnn_elu_backward
5429
5585
 
5430
5586
  - func: elu_(Tensor(a!) self, Scalar alpha=1, Scalar scale=1, Scalar input_scale=1) -> Tensor(a!)
5431
5587
  python_module: nn
5432
5588
  dispatch:
5433
- CPU: legacy::cpu::_thnn_elu_forward_
5434
- CUDA: legacy::cuda::_thnn_elu_forward_
5589
+ CPU: elu_
5590
+ CUDA: elu_
5591
+ QuantizedCPU: quantized_elu_
5435
5592
 
5436
5593
  - func: glu.out(Tensor self, int dim=-1, *, Tensor(a!) out) -> Tensor(a!)
5437
5594
  python_module: nn
5438
5595
  dispatch:
5439
- CPU: legacy::cpu::_thnn_glu_forward_out
5596
+ CPU: glu_out
5440
5597
  CUDA: legacy::cuda::_thnn_glu_forward_out
5441
5598
 
5442
5599
  - func: glu(Tensor self, int dim=-1) -> Tensor
5443
5600
  use_c10_dispatcher: full
5444
5601
  python_module: nn
5445
5602
  dispatch:
5446
- CPU: legacy::cpu::_thnn_glu_forward
5603
+ CPU: glu
5447
5604
  CUDA: legacy::cuda::_thnn_glu_forward
5448
5605
 
5449
5606
  - func: glu_backward.grad_input(Tensor grad_output, Tensor self, int dim, *, Tensor(a!) grad_input) -> Tensor(a!)
5450
5607
  python_module: nn
5451
5608
  dispatch:
5452
- CPU: legacy::cpu::_thnn_glu_backward_out
5609
+ CPU: glu_backward_out
5453
5610
  CUDA: legacy::cuda::_thnn_glu_backward_out
5454
5611
 
5455
5612
  - func: glu_backward(Tensor grad_output, Tensor self, int dim) -> Tensor
5456
5613
  use_c10_dispatcher: full
5457
5614
  python_module: nn
5458
5615
  dispatch:
5459
- CPU: legacy::cpu::_thnn_glu_backward
5616
+ CPU: glu_backward
5460
5617
  CUDA: legacy::cuda::_thnn_glu_backward
5461
5618
 
5619
+ - func: hardsigmoid.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
5620
+ python_module: nn
5621
+
5622
+ - func: hardsigmoid(Tensor self) -> Tensor
5623
+ use_c10_dispatcher: full
5624
+ python_module: nn
5625
+
5626
+ - func: hardsigmoid_(Tensor(a!) self) -> Tensor(a!)
5627
+ python_module: nn
5628
+
5629
+ - func: hardsigmoid_backward(Tensor grad_output, Tensor self) -> Tensor
5630
+ use_c10_dispatcher: full
5631
+ python_module: nn
5632
+
5462
5633
  - func: hardtanh.out(Tensor self, Scalar min_val=-1, Scalar max_val=1, *, Tensor(a!) out) -> Tensor(a!)
5463
5634
  python_module: nn
5464
5635
  dispatch:
5465
- CPU: legacy::cpu::_thnn_hardtanh_forward_out
5466
- CUDA: legacy::cuda::_thnn_hardtanh_forward_out
5636
+ CPU: hardtanh_out
5637
+ CUDA: hardtanh_out
5638
+ QuantizedCPU: quantized_hardtanh_out
5467
5639
 
5468
5640
  - func: hardtanh(Tensor self, Scalar min_val=-1, Scalar max_val=1) -> Tensor
5469
5641
  use_c10_dispatcher: full
5470
5642
  python_module: nn
5471
5643
  dispatch:
5472
- CPU: legacy::cpu::_thnn_hardtanh_forward
5473
- CUDA: legacy::cuda::_thnn_hardtanh_forward
5644
+ CPU: hardtanh
5645
+ CUDA: hardtanh
5646
+ QuantizedCPU: quantized_hardtanh
5474
5647
 
5475
5648
  - func: hardtanh_backward.grad_input(Tensor grad_output, Tensor self, Scalar min_val, Scalar max_val, *, Tensor(a!) grad_input) -> Tensor(a!)
5476
5649
  python_module: nn
5477
5650
  dispatch:
5478
- CPU: legacy::cpu::_thnn_hardtanh_backward_out
5479
- CUDA: legacy::cuda::_thnn_hardtanh_backward_out
5651
+ CPU: hardtanh_backward_out
5652
+ CUDA: hardtanh_backward_out
5480
5653
 
5481
5654
  - func: hardtanh_backward(Tensor grad_output, Tensor self, Scalar min_val, Scalar max_val) -> Tensor
5482
5655
  use_c10_dispatcher: full
5483
5656
  python_module: nn
5484
- dispatch:
5485
- CPU: legacy::cpu::_thnn_hardtanh_backward
5486
- CUDA: legacy::cuda::_thnn_hardtanh_backward
5487
5657
 
5488
5658
  - func: hardtanh_(Tensor(a!) self, Scalar min_val=-1, Scalar max_val=1) -> Tensor(a!)
5489
5659
  python_module: nn
5490
5660
  dispatch:
5491
- CPU: legacy::cpu::_thnn_hardtanh_forward_
5492
- CUDA: legacy::cuda::_thnn_hardtanh_forward_
5661
+ CPU: hardtanh_
5662
+ CUDA: hardtanh_
5663
+ QuantizedCPU: quantized_hardtanh_
5493
5664
 
5494
5665
  - func: leaky_relu.out(Tensor self, Scalar negative_slope=0.01, *, Tensor(a!) out) -> Tensor(a!)
5495
5666
  python_module: nn
5496
5667
  dispatch:
5497
- CPU: legacy::cpu::_thnn_leaky_relu_forward_out
5498
- CUDA: legacy::cuda::_thnn_leaky_relu_forward_out
5668
+ CPU: leaky_relu_out
5669
+ CUDA: leaky_relu_out
5670
+ QuantizedCPU: quantized_leaky_relu_out
5499
5671
 
5500
5672
  - func: leaky_relu(Tensor self, Scalar negative_slope=0.01) -> Tensor
5501
5673
  use_c10_dispatcher: full
5502
5674
  python_module: nn
5503
5675
  dispatch:
5504
- CPU: legacy::cpu::_thnn_leaky_relu_forward
5505
- CUDA: legacy::cuda::_thnn_leaky_relu_forward
5506
-
5507
- - func: leaky_relu_backward.grad_input(Tensor grad_output, Tensor self, Scalar negative_slope, *, Tensor(a!) grad_input) -> Tensor(a!)
5508
- python_module: nn
5509
- dispatch:
5510
- CPU: legacy::cpu::_thnn_leaky_relu_backward_out
5511
- CUDA: legacy::cuda::_thnn_leaky_relu_backward_out
5676
+ CPU: leaky_relu
5677
+ CUDA: leaky_relu
5678
+ QuantizedCPU: quantized_leaky_relu
5512
5679
 
5513
- - func: leaky_relu_backward(Tensor grad_output, Tensor self, Scalar negative_slope) -> Tensor
5680
+ - func: leaky_relu_backward(Tensor grad_output, Tensor self, Scalar negative_slope, bool self_is_result) -> Tensor
5514
5681
  use_c10_dispatcher: full
5515
5682
  python_module: nn
5516
- dispatch:
5517
- CPU: legacy::cpu::_thnn_leaky_relu_backward
5518
- CUDA: legacy::cuda::_thnn_leaky_relu_backward
5519
5683
 
5520
5684
  - func: leaky_relu_(Tensor(a!) self, Scalar negative_slope=0.01) -> Tensor(a!)
5521
5685
  python_module: nn
5522
5686
  dispatch:
5523
- CPU: legacy::cpu::_thnn_leaky_relu_forward_
5524
- CUDA: legacy::cuda::_thnn_leaky_relu_forward_
5687
+ CPU: leaky_relu_
5688
+ CUDA: leaky_relu_
5689
+ QuantizedCPU: quantized_leaky_relu_
5525
5690
 
5526
5691
  - func: log_sigmoid.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
5527
5692
  python_module: nn
@@ -5533,110 +5698,83 @@
5533
5698
  - func: log_sigmoid_forward.output(Tensor self, *, Tensor(a!) output, Tensor(b!) buffer) -> (Tensor(a!), Tensor(b!))
5534
5699
  python_module: nn
5535
5700
  dispatch:
5536
- CPU: legacy::cpu::_thnn_log_sigmoid_forward_out
5701
+ CPU: log_sigmoid_forward_out_cpu
5537
5702
  CUDA: legacy::cuda::_thnn_log_sigmoid_forward_out
5538
5703
 
5539
5704
  - func: log_sigmoid_forward(Tensor self) -> (Tensor output, Tensor buffer)
5540
5705
  python_module: nn
5541
5706
  dispatch:
5542
- CPU: legacy::cpu::_thnn_log_sigmoid_forward
5707
+ CPU: log_sigmoid_forward_cpu
5543
5708
  CUDA: legacy::cuda::_thnn_log_sigmoid_forward
5544
5709
 
5545
5710
  - func: log_sigmoid_backward.grad_input(Tensor grad_output, Tensor self, Tensor buffer, *, Tensor(a!) grad_input) -> Tensor(a!)
5546
5711
  python_module: nn
5547
5712
  dispatch:
5548
- CPU: legacy::cpu::_thnn_log_sigmoid_backward_out
5713
+ CPU: log_sigmoid_backward_out_cpu
5549
5714
  CUDA: legacy::cuda::_thnn_log_sigmoid_backward_out
5550
5715
 
5551
5716
  - func: log_sigmoid_backward(Tensor grad_output, Tensor self, Tensor buffer) -> Tensor
5552
5717
  use_c10_dispatcher: full
5553
5718
  python_module: nn
5554
5719
  dispatch:
5555
- CPU: legacy::cpu::_thnn_log_sigmoid_backward
5720
+ CPU: log_sigmoid_backward_cpu
5556
5721
  CUDA: legacy::cuda::_thnn_log_sigmoid_backward
5557
5722
 
5558
5723
  - func: rrelu_with_noise.out(Tensor self, Tensor noise, Scalar lower=0.125, Scalar upper=0.3333333333333333, bool training=False, Generator? generator=None, *, Tensor(a!) out) -> Tensor(a!)
5559
5724
  python_module: nn
5560
5725
  dispatch:
5561
- CPU: legacy::cpu::_thnn_rrelu_with_noise_forward_out
5726
+ CPU: rrelu_with_noise_out_cpu
5562
5727
  CUDA: legacy::cuda::_thnn_rrelu_with_noise_forward_out
5563
5728
 
5564
5729
  - func: rrelu_with_noise(Tensor self, Tensor noise, Scalar lower=0.125, Scalar upper=0.3333333333333333, bool training=False, Generator? generator=None) -> Tensor
5565
5730
  python_module: nn
5566
5731
  dispatch:
5567
- CPU: legacy::cpu::_thnn_rrelu_with_noise_forward
5732
+ CPU: rrelu_with_noise_cpu
5568
5733
  CUDA: legacy::cuda::_thnn_rrelu_with_noise_forward
5569
5734
 
5570
- - func: rrelu_with_noise_backward.grad_input(Tensor grad_output, Tensor self, Tensor noise, Scalar lower, Scalar upper, bool training, *, Tensor(a!) grad_input) -> Tensor(a!)
5571
- python_module: nn
5572
- dispatch:
5573
- CPU: legacy::cpu::_thnn_rrelu_with_noise_backward_out
5574
- CUDA: legacy::cuda::_thnn_rrelu_with_noise_backward_out
5575
-
5576
- - func: rrelu_with_noise_backward(Tensor grad_output, Tensor self, Tensor noise, Scalar lower, Scalar upper, bool training) -> Tensor
5735
+ - func: rrelu_with_noise_backward(Tensor grad_output, Tensor self, Tensor noise, Scalar lower, Scalar upper, bool training, bool self_is_result) -> Tensor
5577
5736
  use_c10_dispatcher: full
5578
5737
  python_module: nn
5579
- dispatch:
5580
- CPU: legacy::cpu::_thnn_rrelu_with_noise_backward
5581
- CUDA: legacy::cuda::_thnn_rrelu_with_noise_backward
5582
5738
 
5583
5739
  - func: rrelu_with_noise_(Tensor(a!) self, Tensor noise, Scalar lower=0.125, Scalar upper=0.3333333333333333, bool training=False, Generator? generator=None) -> Tensor(a!)
5584
5740
  python_module: nn
5585
5741
  dispatch:
5586
- CPU: legacy::cpu::_thnn_rrelu_with_noise_forward_
5742
+ CPU: rrelu_with_noise_cpu_
5587
5743
  CUDA: legacy::cuda::_thnn_rrelu_with_noise_forward_
5588
5744
 
5589
5745
  - func: softplus.out(Tensor self, Scalar beta=1, Scalar threshold=20, *, Tensor(a!) out) -> Tensor(a!)
5590
5746
  python_module: nn
5591
- dispatch:
5592
- CPU: legacy::cpu::_thnn_softplus_forward_out
5593
- CUDA: legacy::cuda::_thnn_softplus_forward_out
5594
5747
 
5595
5748
  - func: softplus(Tensor self, Scalar beta=1, Scalar threshold=20) -> Tensor
5596
5749
  use_c10_dispatcher: full
5597
5750
  python_module: nn
5598
- dispatch:
5599
- CPU: legacy::cpu::_thnn_softplus_forward
5600
- CUDA: legacy::cuda::_thnn_softplus_forward
5601
5751
 
5602
5752
  - func: softplus_backward.grad_input(Tensor grad_output, Tensor self, Scalar beta, Scalar threshold, Tensor output, *, Tensor(a!) grad_input) -> Tensor(a!)
5603
5753
  python_module: nn
5604
5754
  dispatch:
5605
- CPU: legacy::cpu::_thnn_softplus_backward_out
5606
- CUDA: legacy::cuda::_thnn_softplus_backward_out
5755
+ CPU: softplus_backward_out
5756
+ CUDA: softplus_backward_out
5607
5757
 
5608
5758
  - func: softplus_backward(Tensor grad_output, Tensor self, Scalar beta, Scalar threshold, Tensor output) -> Tensor
5609
5759
  use_c10_dispatcher: full
5610
5760
  python_module: nn
5611
- dispatch:
5612
- CPU: legacy::cpu::_thnn_softplus_backward
5613
- CUDA: legacy::cuda::_thnn_softplus_backward
5614
5761
 
5615
5762
  - func: softshrink.out(Tensor self, Scalar lambd=0.5, *, Tensor(a!) out) -> Tensor(a!)
5616
5763
  python_module: nn
5617
- dispatch:
5618
- CPU: legacy::cpu::_thnn_softshrink_forward_out
5619
- CUDA: legacy::cuda::_thnn_softshrink_forward_out
5620
5764
 
5621
5765
  - func: softshrink(Tensor self, Scalar lambd=0.5) -> Tensor
5622
5766
  use_c10_dispatcher: full
5623
5767
  python_module: nn
5624
- dispatch:
5625
- CPU: legacy::cpu::_thnn_softshrink_forward
5626
- CUDA: legacy::cuda::_thnn_softshrink_forward
5627
5768
 
5628
5769
  - func: softshrink_backward.grad_input(Tensor grad_output, Tensor self, Scalar lambd, *, Tensor(a!) grad_input) -> Tensor(a!)
5629
5770
  python_module: nn
5630
5771
  dispatch:
5631
- CPU: legacy::cpu::_thnn_softshrink_backward_out
5632
- CUDA: legacy::cuda::_thnn_softshrink_backward_out
5772
+ CPU: softshrink_backward_out
5773
+ CUDA: softshrink_backward_out
5633
5774
 
5634
5775
  - func: softshrink_backward(Tensor grad_output, Tensor self, Scalar lambd) -> Tensor
5635
5776
  use_c10_dispatcher: full
5636
5777
  python_module: nn
5637
- dispatch:
5638
- CPU: legacy::cpu::_thnn_softshrink_backward
5639
- CUDA: legacy::cuda::_thnn_softshrink_backward
5640
5778
 
5641
5779
  - func: adaptive_avg_pool2d.out(Tensor self, int[2] output_size, *, Tensor(a!) out) -> Tensor(a!)
5642
5780
  python_module: nn
@@ -5783,6 +5921,7 @@
5783
5921
  dispatch:
5784
5922
  CPU: avg_pool3d_cpu
5785
5923
  CUDA: avg_pool3d_cuda
5924
+ QuantizedCPU: quantized_avg_pool3d
5786
5925
 
5787
5926
  - func: avg_pool3d_backward.grad_input(Tensor grad_output, Tensor self, int[3] kernel_size, int[3] stride, int[3] padding, bool ceil_mode, bool count_include_pad, int? divisor_override, *, Tensor(a!) grad_input) -> Tensor(a!)
5788
5927
  python_module: nn
@@ -5861,6 +6000,7 @@
5861
6000
  dispatch:
5862
6001
  CPU: max_pool2d_with_indices_cpu
5863
6002
  CUDA: max_pool2d_with_indices_cuda
6003
+ supports_named_tensor: True
5864
6004
 
5865
6005
  - func: max_pool2d_with_indices_backward.grad_input(Tensor grad_output, Tensor self, int[2] kernel_size, int[2] stride, int[2] padding, int[2] dilation, bool ceil_mode, Tensor indices, *, Tensor(a!) grad_input) -> Tensor(a!)
5866
6006
  python_module: nn
@@ -5887,6 +6027,7 @@
5887
6027
  dispatch:
5888
6028
  CPU: max_pool3d_with_indices_cpu
5889
6029
  CUDA: max_pool3d_with_indices_cuda
6030
+ supports_named_tensor: True
5890
6031
 
5891
6032
  - func: max_pool3d_with_indices_backward.grad_input(Tensor grad_output, Tensor self, int[3] kernel_size, int[3] stride, int[3] padding, int[3] dilation, bool ceil_mode, Tensor indices, *, Tensor(a!) grad_input) -> Tensor(a!)
5892
6033
  python_module: nn
@@ -6068,174 +6209,172 @@
6068
6209
  CPU: replication_pad3d_backward_cpu
6069
6210
  CUDA: replication_pad3d_backward_cuda
6070
6211
 
6071
- - func: _test_optional_float(Tensor self, *, float? scale=None) -> Tensor
6072
- variants: function
6073
-
6074
- - func: upsample_linear1d.out(Tensor self, int[1] output_size, bool align_corners, *, Tensor(a!) out) -> Tensor(a!)
6212
+ - func: upsample_linear1d.out(Tensor self, int[1] output_size, bool align_corners, float? scales=None, *, Tensor(a!) out) -> Tensor(a!)
6075
6213
  python_module: nn
6076
6214
  dispatch:
6077
6215
  CPU: upsample_linear1d_out_cpu
6078
6216
  CUDA: upsample_linear1d_out_cuda
6079
6217
 
6080
- - func: upsample_linear1d(Tensor self, int[1] output_size, bool align_corners) -> Tensor
6218
+ - func: upsample_linear1d(Tensor self, int[1] output_size, bool align_corners, float? scales=None) -> Tensor
6081
6219
  python_module: nn
6082
6220
  dispatch:
6083
6221
  CPU: upsample_linear1d_cpu
6084
6222
  CUDA: upsample_linear1d_cuda
6085
6223
 
6086
- - func: upsample_linear1d_backward.grad_input(Tensor grad_output, int[1] output_size, int[3] input_size, bool align_corners, *, Tensor(a!) grad_input) -> Tensor(a!)
6224
+ - func: upsample_linear1d_backward.grad_input(Tensor grad_output, int[1] output_size, int[3] input_size, bool align_corners, float? scales=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6087
6225
  python_module: nn
6088
6226
  dispatch:
6089
6227
  CPU: upsample_linear1d_backward_out_cpu
6090
6228
  CUDA: upsample_linear1d_backward_out_cuda
6091
6229
 
6092
- - func: upsample_linear1d_backward(Tensor grad_output, int[1] output_size, int[3] input_size, bool align_corners) -> Tensor
6230
+ - func: upsample_linear1d_backward(Tensor grad_output, int[1] output_size, int[3] input_size, bool align_corners, float? scales=None) -> Tensor
6093
6231
  python_module: nn
6094
6232
  dispatch:
6095
6233
  CPU: upsample_linear1d_backward_cpu
6096
6234
  CUDA: upsample_linear1d_backward_cuda
6097
6235
 
6098
- - func: upsample_bilinear2d.out(Tensor self, int[2] output_size, bool align_corners, *, Tensor(a!) out) -> Tensor(a!)
6236
+ - func: upsample_bilinear2d.out(Tensor self, int[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)
6099
6237
  python_module: nn
6100
6238
  dispatch:
6101
6239
  CPU: upsample_bilinear2d_out_cpu
6102
6240
  CUDA: upsample_bilinear2d_out_cuda
6103
6241
 
6104
- - func: upsample_bilinear2d(Tensor self, int[2] output_size, bool align_corners) -> Tensor
6242
+ - func: upsample_bilinear2d(Tensor self, int[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor
6105
6243
  python_module: nn
6106
6244
  dispatch:
6107
6245
  CPU: upsample_bilinear2d_cpu
6108
6246
  CUDA: upsample_bilinear2d_cuda
6109
6247
  QuantizedCPU: quantized_upsample_bilinear2d_cpu
6110
6248
 
6111
- - func: upsample_bilinear2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, *, Tensor(a!) grad_input) -> Tensor(a!)
6249
+ - func: upsample_bilinear2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6112
6250
  python_module: nn
6113
6251
  dispatch:
6114
6252
  CPU: upsample_bilinear2d_backward_out_cpu
6115
6253
  CUDA: upsample_bilinear2d_backward_out_cuda
6116
6254
 
6117
- - func: upsample_bilinear2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners) -> Tensor
6255
+ - func: upsample_bilinear2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor
6118
6256
  python_module: nn
6119
6257
  dispatch:
6120
6258
  CPU: upsample_bilinear2d_backward_cpu
6121
6259
  CUDA: upsample_bilinear2d_backward_cuda
6122
6260
 
6123
- - func: upsample_bicubic2d.out(Tensor self, int[2] output_size, bool align_corners, *, Tensor(a!) out) -> Tensor(a!)
6261
+ - func: upsample_bicubic2d.out(Tensor self, int[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)
6124
6262
  python_module: nn
6125
6263
  dispatch:
6126
6264
  CPU: upsample_bicubic2d_out_cpu
6127
6265
  CUDA: upsample_bicubic2d_out_cuda
6128
6266
 
6129
- - func: upsample_bicubic2d(Tensor self, int[2] output_size, bool align_corners) -> Tensor
6267
+ - func: upsample_bicubic2d(Tensor self, int[2] output_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor
6130
6268
  python_module: nn
6131
6269
  dispatch:
6132
6270
  CPU: upsample_bicubic2d_cpu
6133
6271
  CUDA: upsample_bicubic2d_cuda
6134
6272
 
6135
- - func: upsample_bicubic2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, *, Tensor(a!) grad_input) -> Tensor(a!)
6273
+ - func: upsample_bicubic2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6136
6274
  python_module: nn
6137
6275
  dispatch:
6138
6276
  CPU: upsample_bicubic2d_backward_out_cpu
6139
6277
  CUDA: upsample_bicubic2d_backward_out_cuda
6140
6278
 
6141
- - func: upsample_bicubic2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners) -> Tensor
6279
+ - func: upsample_bicubic2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size, bool align_corners, float? scales_h=None, float? scales_w=None) -> Tensor
6142
6280
  python_module: nn
6143
6281
  dispatch:
6144
6282
  CPU: upsample_bicubic2d_backward_cpu
6145
6283
  CUDA: upsample_bicubic2d_backward_cuda
6146
6284
 
6147
- - func: upsample_trilinear3d.out(Tensor self, int[3] output_size, bool align_corners, *, Tensor(a!) out) -> Tensor(a!)
6285
+ - func: upsample_trilinear3d.out(Tensor self, int[3] output_size, bool align_corners, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)
6148
6286
  python_module: nn
6149
6287
  dispatch:
6150
6288
  CPU: upsample_trilinear3d_out_cpu
6151
6289
  CUDA: upsample_trilinear3d_out_cuda
6152
6290
 
6153
- - func: upsample_trilinear3d(Tensor self, int[3] output_size, bool align_corners) -> Tensor
6291
+ - func: upsample_trilinear3d(Tensor self, int[3] output_size, bool align_corners, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor
6154
6292
  python_module: nn
6155
6293
  dispatch:
6156
6294
  CPU: upsample_trilinear3d_cpu
6157
6295
  CUDA: upsample_trilinear3d_cuda
6158
6296
 
6159
- - func: upsample_trilinear3d_backward.grad_input(Tensor grad_output, int[3] output_size, int[5] input_size, bool align_corners, *, Tensor(a!) grad_input) -> Tensor(a!)
6297
+ - func: upsample_trilinear3d_backward.grad_input(Tensor grad_output, int[3] output_size, int[5] input_size, bool align_corners, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6160
6298
  python_module: nn
6161
6299
  dispatch:
6162
6300
  CPU: upsample_trilinear3d_backward_out_cpu
6163
6301
  CUDA: upsample_trilinear3d_backward_out_cuda
6164
6302
 
6165
- - func: upsample_trilinear3d_backward(Tensor grad_output, int[3] output_size, int[5] input_size, bool align_corners) -> Tensor
6303
+ - func: upsample_trilinear3d_backward(Tensor grad_output, int[3] output_size, int[5] input_size, bool align_corners, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor
6166
6304
  python_module: nn
6167
6305
  dispatch:
6168
6306
  CPU: upsample_trilinear3d_backward_cpu
6169
6307
  CUDA: upsample_trilinear3d_backward_cuda
6170
6308
 
6171
- - func: upsample_nearest1d.out(Tensor self, int[1] output_size, *, Tensor(a!) out) -> Tensor(a!)
6309
+ - func: upsample_nearest1d.out(Tensor self, int[1] output_size, float? scales=None, *, Tensor(a!) out) -> Tensor(a!)
6172
6310
  python_module: nn
6173
6311
  dispatch:
6174
6312
  CPU: upsample_nearest1d_out_cpu
6175
6313
  CUDA: upsample_nearest1d_out_cuda
6176
6314
 
6177
- - func: upsample_nearest1d(Tensor self, int[1] output_size) -> Tensor
6315
+ - func: upsample_nearest1d(Tensor self, int[1] output_size, float? scales=None) -> Tensor
6178
6316
  python_module: nn
6179
6317
  dispatch:
6180
6318
  CPU: upsample_nearest1d_cpu
6181
6319
  CUDA: upsample_nearest1d_cuda
6182
6320
 
6183
- - func: upsample_nearest1d_backward.grad_input(Tensor grad_output, int[1] output_size, int[3] input_size, *, Tensor(a!) grad_input) -> Tensor(a!)
6321
+ - func: upsample_nearest1d_backward.grad_input(Tensor grad_output, int[1] output_size, int[3] input_size, float? scales=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6184
6322
  python_module: nn
6185
6323
  dispatch:
6186
6324
  CPU: upsample_nearest1d_backward_out_cpu
6187
6325
  CUDA: upsample_nearest1d_backward_out_cuda
6188
6326
 
6189
- - func: upsample_nearest1d_backward(Tensor grad_output, int[1] output_size, int[3] input_size) -> Tensor
6327
+ - func: upsample_nearest1d_backward(Tensor grad_output, int[1] output_size, int[3] input_size, float? scales=None) -> Tensor
6190
6328
  python_module: nn
6191
6329
  dispatch:
6192
6330
  CPU: upsample_nearest1d_backward_cpu
6193
6331
  CUDA: upsample_nearest1d_backward_cuda
6194
6332
 
6195
- - func: upsample_nearest2d.out(Tensor self, int[2] output_size, *, Tensor(a!) out) -> Tensor(a!)
6333
+ - func: upsample_nearest2d.out(Tensor self, int[2] output_size, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)
6196
6334
  python_module: nn
6197
6335
  dispatch:
6198
6336
  CPU: upsample_nearest2d_out_cpu
6199
6337
  CUDA: upsample_nearest2d_out_cuda
6200
6338
 
6201
- - func: upsample_nearest2d(Tensor self, int[2] output_size) -> Tensor
6339
+ - func: upsample_nearest2d(Tensor self, int[2] output_size, float? scales_h=None, float? scales_w=None) -> Tensor
6202
6340
  python_module: nn
6203
6341
  dispatch:
6204
6342
  CPU: upsample_nearest2d_cpu
6205
6343
  CUDA: upsample_nearest2d_cuda
6206
6344
  QuantizedCPU: quantized_upsample_nearest2d_cpu
6207
6345
 
6208
- - func: upsample_nearest2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, *, Tensor(a!) grad_input) -> Tensor(a!)
6346
+ - func: upsample_nearest2d_backward.grad_input(Tensor grad_output, int[2] output_size, int[4] input_size, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6209
6347
  python_module: nn
6210
6348
  dispatch:
6211
6349
  CPU: upsample_nearest2d_backward_out_cpu
6212
6350
  CUDA: upsample_nearest2d_backward_out_cuda
6213
6351
 
6214
- - func: upsample_nearest2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size) -> Tensor
6352
+ - func: upsample_nearest2d_backward(Tensor grad_output, int[2] output_size, int[4] input_size, float? scales_h=None, float? scales_w=None) -> Tensor
6215
6353
  python_module: nn
6216
6354
  dispatch:
6217
6355
  CPU: upsample_nearest2d_backward_cpu
6218
6356
  CUDA: upsample_nearest2d_backward_cuda
6219
6357
 
6220
- - func: upsample_nearest3d.out(Tensor self, int[3] output_size, *, Tensor(a!) out) -> Tensor(a!)
6358
+ - func: upsample_nearest3d.out(Tensor self, int[3] output_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) out) -> Tensor(a!)
6221
6359
  python_module: nn
6222
6360
  dispatch:
6223
6361
  CPU: upsample_nearest3d_out_cpu
6224
6362
  CUDA: upsample_nearest3d_out_cuda
6225
6363
 
6226
- - func: upsample_nearest3d(Tensor self, int[3] output_size) -> Tensor
6364
+ - func: upsample_nearest3d(Tensor self, int[3] output_size, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor
6227
6365
  python_module: nn
6228
6366
  dispatch:
6229
6367
  CPU: upsample_nearest3d_cpu
6230
6368
  CUDA: upsample_nearest3d_cuda
6369
+ QuantizedCPU: quantized_upsample_nearest3d_cpu
6231
6370
 
6232
- - func: upsample_nearest3d_backward.grad_input(Tensor grad_output, int[3] output_size, int[5] input_size, *, Tensor(a!) grad_input) -> Tensor(a!)
6371
+ - func: upsample_nearest3d_backward.grad_input(Tensor grad_output, int[3] output_size, int[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None, *, Tensor(a!) grad_input) -> Tensor(a!)
6233
6372
  python_module: nn
6234
6373
  dispatch:
6235
6374
  CPU: upsample_nearest3d_backward_out_cpu
6236
6375
  CUDA: upsample_nearest3d_backward_out_cuda
6237
6376
 
6238
- - func: upsample_nearest3d_backward(Tensor grad_output, int[3] output_size, int[5] input_size) -> Tensor
6377
+ - func: upsample_nearest3d_backward(Tensor grad_output, int[3] output_size, int[5] input_size, float? scales_d=None, float? scales_h=None, float? scales_w=None) -> Tensor
6239
6378
  python_module: nn
6240
6379
  dispatch:
6241
6380
  CPU: upsample_nearest3d_backward_cpu
@@ -6254,15 +6393,12 @@
6254
6393
  - func: tanh_backward.grad_input(Tensor grad_output, Tensor output, *, Tensor(a!) grad_input) -> Tensor(a!)
6255
6394
  python_module: nn
6256
6395
  dispatch:
6257
- CPU: legacy::cpu::_thnn_tanh_backward_out
6258
- CUDA: legacy::cuda::_thnn_tanh_backward_out
6396
+ CPU: tanh_backward_out
6397
+ CUDA: tanh_backward_out
6259
6398
 
6260
6399
  - func: tanh_backward(Tensor grad_output, Tensor output) -> Tensor
6261
6400
  use_c10_dispatcher: full
6262
6401
  python_module: nn
6263
- dispatch:
6264
- CPU: legacy::cpu::_thnn_tanh_backward
6265
- CUDA: legacy::cuda::_thnn_tanh_backward
6266
6402
 
6267
6403
  # What's a thnn_conv_ versus a slow_conv_?
6268
6404
  #
@@ -6489,3 +6625,9 @@
6489
6625
  variants: function
6490
6626
  device_guard: False
6491
6627
  supports_named_tensor: True
6628
+
6629
+ - func: isinf(Tensor self) -> Tensor
6630
+ use_c10_dispatcher: full
6631
+ variants: function
6632
+ device_guard: False
6633
+ supports_named_tensor: True