forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
native_functions.yaml
9176 lines (7293 loc) · 336 KB
/
native_functions.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# See README.md in this directory for more guidance
# *********NB: _cast_* operators are DEPRECATED and will be removed
# eventually. These were previously used before TorchScript IR supported
# representing ScalarType's. They are now superseded by usage of
# `aten::to()`. The ops remain here for backward compatibility purposes.
# DEPRECATED. DO NOT USE
- func: _cast_Byte(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Char(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Double(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Float(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Int(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Long(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Short(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# DEPRECATED. DO NOT USE
- func: _cast_Half(Tensor self, bool non_blocking=False) -> Tensor
variants: function
# Computes the gradient of current tensor w.r.t. graph leaves.
- func: _backward(Tensor self, Tensor[] inputs, Tensor? gradient=None, bool? retain_graph=None, bool create_graph=False) -> ()
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
manual_kernel_registration: True
variants: method
# DEPRECATED. Sets the tensor data held by this `Variable` to be the same as
# `new_data`. It requires that `new_data` and `Variable` have compatible tensor
# type, by checking `_has_compatible_shallow_copy_type(this, new_data)`.
#
# This function is deprecated because it doesn't really make sense in a world
# where Variables *are* Tensors (as opposed to them containing tensors, which
# is what the previous interpretation was.)
- func: set_data(Tensor(a!) self, Tensor new_data) -> ()
manual_kernel_registration: True
variants: method
- func: data(Tensor self) -> Tensor
manual_kernel_registration: True
variants: method
# True if this `Variable` is a leaf and thus does not have a `grad_fn`.
- func: is_leaf(Tensor self) -> bool
manual_kernel_registration: True
variants: method
# Returns the output index of this variable from the forward operation that
# produced it. Conversely, it returns the input index of the gradient `Node` to
# which this `Variable` is connected (because in the gradient computation,
# inputs and outputs switch meaning). For example:
#
# y0, y1, y2 = f(x)
# assert y0.output_nr == 0
# assert y1.output_nr == 1
# assert y2.output_nr == 2
#
- func: output_nr(Tensor self) -> int
manual_kernel_registration: True
variants: method
- func: _version(Tensor self) -> int
manual_kernel_registration: True
variants: method
- func: requires_grad_(Tensor(a!) self, bool requires_grad=True) -> Tensor(a!)
manual_kernel_registration: True
variants: method
# Enables .grad attribute for non-leaf Tensors.
- func: retain_grad(Tensor(a!) self) -> ()
manual_kernel_registration: True
variants: method
- func: _fw_primal(Tensor(a) self, int level) -> Tensor(a)
use_c10_dispatcher: full
variants: method
dispatch:
DefaultBackend: _fw_primal
- func: make_dual(Tensor(a) primal, Tensor tangent, int level) -> Tensor(a)
use_c10_dispatcher: full
variants: function
- func: unpack_dual(Tensor(a) dual, int level) -> (Tensor(a) primal, Tensor tangent)
use_c10_dispatcher: full
variants: function
- func: rename_(Tensor(a!) self, Dimname[]? names) -> Tensor(a!)
variants: method
- func: rename(Tensor(a) self, Dimname[]? names) -> Tensor(a)
variants: method
- func: align_to(Tensor(a) self, Dimname[] names) -> Tensor(a)
variants: method
- func: align_to.ellipsis_idx(Tensor(a) self, Dimname[] order, int ellipsis_idx) -> Tensor(a)
variants: method
- func: align_as(Tensor self, Tensor other) -> Tensor
variants: method
- func: align_tensors(Tensor[] tensors) -> Tensor[]
- func: refine_names(Tensor(a) self, Dimname[] names) -> Tensor(a)
variants: method
- func: _use_cudnn_ctc_loss(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank) -> bool
dispatch:
CUDA: _use_cudnn_ctc_loss
- func: _cudnn_ctc_loss(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank, bool deterministic, bool zero_infinity) -> (Tensor, Tensor)
dispatch:
CUDA: _cudnn_ctc_loss
- func: _use_cudnn_rnn_flatten_weight() -> bool
- func: _cudnn_rnn_flatten_weight(Tensor[] weight_arr, int weight_stride0, int input_size, int mode, int hidden_size, int proj_size, int num_layers, bool batch_first, bool bidirectional) -> Tensor
dispatch:
CUDA: _cudnn_rnn_flatten_weight
- func: _cudnn_rnn(Tensor input, Tensor[] weight, int weight_stride0, Tensor? weight_buf, Tensor hx, Tensor? cx, int mode, int hidden_size, int proj_size, int num_layers, bool batch_first, float dropout, bool train, bool bidirectional, int[] batch_sizes, Tensor? dropout_state) -> (Tensor, Tensor, Tensor, Tensor, Tensor)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CUDA: _cudnn_rnn
- func: _cudnn_rnn_backward(Tensor input, Tensor[] weight, int weight_stride0, Tensor weight_buf, Tensor hx, Tensor? cx, Tensor output, Tensor? grad_output, Tensor? grad_hy, Tensor? grad_cy, int mode, int hidden_size, int proj_size, int num_layers, bool batch_first, float dropout, bool train, bool bidirectional, int[] batch_sizes, Tensor? dropout_state, Tensor reserve, bool[4] output_mask) -> (Tensor, Tensor, Tensor, Tensor[])
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CUDA: _cudnn_rnn_backward
- func: _cudnn_init_dropout_state(float dropout, bool train, int dropout_seed, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=False) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CUDA: _cudnn_init_dropout_state
- func: _debug_has_internal_overlap(Tensor self) -> int
variants: function
- func: _fused_dropout(Tensor self, float p, Generator? generator=None) -> (Tensor, Tensor)
variants: function
dispatch:
CUDA: fused_dropout_cuda
- func: _masked_scale(Tensor self, Tensor mask, float scale) -> Tensor
variants: function
dispatch:
CUDA: masked_scale_cuda
- func: _sobol_engine_draw(Tensor quasi, int n, Tensor sobolstate, int dimension, int num_generated, ScalarType? dtype) -> (Tensor, Tensor)
- func: _sobol_engine_ff_(Tensor(a!) self, int n, Tensor sobolstate, int dimension, int num_generated) -> Tensor(a!)
- func: _sobol_engine_scramble_(Tensor(a!) self, Tensor ltm, int dimension) -> Tensor(a!)
- func: _sobol_engine_initialize_state_(Tensor(a!) self, int dimension) -> Tensor(a!)
- func: _reshape_from_tensor(Tensor self, Tensor shape) -> Tensor
- func: _shape_as_tensor(Tensor self) -> Tensor
- func: dropout(Tensor input, float p, bool train) -> Tensor
- func: dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
- func: feature_dropout(Tensor input, float p, bool train) -> Tensor
- func: feature_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
- func: alpha_dropout(Tensor input, float p, bool train) -> Tensor
- func: alpha_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
- func: feature_alpha_dropout(Tensor input, float p, bool train) -> Tensor
- func: feature_alpha_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
- func: abs(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: abs
- func: abs_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: abs_
- func: abs.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: abs_out
# Note [Adding an alias]
# To add an alias do the following:
#
# 1) Copy the original functions native_functions.yaml entry, but replace the
# original function's name with their own and delete any dispatch
# keys for the aliases. Specifying a dispatch key will prevent
# autograd from recording the operations the alias performs, which
# will stop it from "inheriting" the original operation's autograd behavior.
# 2) Implement the corresponding functions and have them redispatch to the
# original function.
# 3) Add entries for the alias (and original function, if needed) to
# aten/src/ATen/core/interned_strings.h
# (This may require removing an entry from ATen/core/aten_interned_strings.h.)
# 4) Add docstrings to the new function that reference the original function,
# and document the method as usual (if it exists.)
# (See torch/_torch_docs.py and docs/source/torch.rst if adding a function,
# torch/_tensor_docs.py and docs/source/tensors.rst if adding a method,
# or module-specific doc bindings (like torch/linalg/__init__.py) if
# adding an alias in a namespace.)
# 5) Update torch/overrides.py consistent with the original function.
# 6) Update the alias_map in torch/csrc/jit/passes/normalize_ops.cpp.
# 7) Add entries to test/test_op_aliases.py's "alias_infos"
#
# See torch.absolute, an alias for torch.abs, as an example.
# Absolute, alias for abs
- func: absolute(Tensor self) -> Tensor
variants: function, method
- func: absolute_(Tensor(a!) self) -> Tensor(a!)
variants: method
- func: absolute.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: angle(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: angle
- func: angle.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: angle_out
- func: view_as_real(Tensor(a) self) -> Tensor(a)
variants: function
dispatch:
CPU, CUDA: view_as_real
- func: view_as_complex(Tensor(a) self) -> Tensor(a)
variants: function
dispatch:
CPU, CUDA: view_as_complex
- func: sgn(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: sgn
- func: sgn_(Tensor(a!) self) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: method
dispatch:
DefaultBackend: sgn_
- func: sgn.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: sgn_out
- func: real(Tensor(a) self) -> Tensor(a)
variants: function
- func: imag(Tensor(a) self) -> Tensor(a)
variants: function
- func: conj(Tensor(a) self) -> Tensor(a)
variants: function, method
- func: conj.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: conj_out
- func: _conj(Tensor self) -> Tensor
variants: function
dispatch:
DefaultBackend: _conj
- func: acos(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: acos
- func: acos_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: acos_
- func: acos.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: acos_out
# arccos, alias of acos
- func: arccos(Tensor self) -> Tensor
variants: function, method
- func: arccos_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arccos.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: avg_pool1d(Tensor self, int[1] kernel_size, int[1] stride=[], int[1] padding=0, bool ceil_mode=False, bool count_include_pad=True) -> Tensor
- func: adaptive_avg_pool1d(Tensor self, int[1] output_size) -> Tensor
# Return: (Tensor output, Tensor indices)
- func: adaptive_max_pool1d(Tensor self, int[1] output_size) -> (Tensor, Tensor)
- func: add.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor
structured_delegate: add.out
variants: function, method
dispatch:
CPU, CUDA: add
SparseCPU, SparseCUDA: add_sparse
MkldnnCPU: mkldnn_add
- func: add_.Tensor(Tensor(a!) self, Tensor other, *, Scalar alpha=1) -> Tensor(a!)
variants: method
structured_delegate: add.out
dispatch:
CPU, CUDA: add_
SparseCPU, SparseCUDA: add_sparse_
MkldnnCPU: mkldnn_add_
- func: add.out(Tensor self, Tensor other, *, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: full
structured: True
structured_inherits: TensorIteratorBase
dispatch:
CPU, CUDA: add_out
SparseCPU: add_out_sparse_cpu
SparseCUDA: add_out_sparse_cuda
MkldnnCPU: mkldnn_add_out
- func: _add_relu.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor
variants: function
dispatch:
CPU: add_relu
- func: _add_relu_.Tensor(Tensor(a!) self, Tensor other, *, Scalar alpha=1) -> Tensor(a!)
variants: function
dispatch:
CPU: add_relu_
- func: _add_relu.out(Tensor self, Tensor other, *, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
CPU: add_relu_out
# For C++ only, until we have conversion from C++ numbers to Tensor
- func: add.Scalar(Tensor self, Scalar other, Scalar alpha=1) -> Tensor
variants: function, method
dispatch:
DefaultBackend: add
- func: add_.Scalar(Tensor(a!) self, Scalar other, Scalar alpha=1) -> Tensor(a!)
variants: method
dispatch:
DefaultBackend: add_
- func: addmv(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: addmv
- func: addmv_(Tensor(a!) self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
variants: function, method
dispatch:
CPU, CUDA: addmv_
- func: addmv.out(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: addmv_out
- func: _addmv_impl_(Tensor(a!) self, Tensor self2, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
dispatch:
CPU: addmv_impl_cpu
CUDA: addmv_impl_cuda
- func: addr(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: addr
Math: math_addr
- func: addr_(Tensor(a!) self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
variants: method
dispatch:
DefaultBackend: addr_
- func: addr.out(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: addr_out
Math: math_addr_out
- func: affine_grid_generator(Tensor theta, int[] size, bool align_corners) -> Tensor
variants: function
dispatch:
DefaultBackend: affine_grid_generator
- func: affine_grid_generator_backward(Tensor grad, int[] size, bool align_corners) -> Tensor
variants: function
- func: all.dim(Tensor self, int dim, bool keepdim=False) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: all
- func: all.out(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: all_out
- func: all.dimname(Tensor self, Dimname dim, bool keepdim=False) -> Tensor
variants: function, method
- func: all.dimname_out(Tensor self, Dimname dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: allclose(Tensor self, Tensor other, float rtol=1e-05, float atol=1e-08, bool equal_nan=False) -> bool
variants: function, method
- func: any.dim(Tensor self, int dim, bool keepdim=False) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: any
- func: any.out(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: any_out
- func: any.dimname(Tensor self, Dimname dim, bool keepdim=False) -> Tensor
variants: function, method
- func: any.dimname_out(Tensor self, Dimname dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: arange(Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: arange.start(Scalar start, Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: arange.start_step(Scalar start, Scalar end, Scalar step, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: arange.out(Scalar end, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: arange.start_out(Scalar start, Scalar end, Scalar step=1, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU: arange_cpu_out
CUDA: arange_cuda_out
# This function is a temporary hack to allow tracing of arange like constructs with dynamic
# bounds on arange. Normal arange is not traceable because it does not take any tensor inputs;
# if the range you need is based on another tensor, calling this function directly will
# preserve tracing. Get rid of this when arange can directly take tensors for bounds
# (so that it can be traced directly).
- func: _dim_arange(Tensor like, int dim) -> Tensor
- func: argmax(Tensor self, int? dim=None, bool keepdim=False) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: argmax
- func: argmax.out(Tensor self, int? dim=None, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: argmax_out
- func: argmin(Tensor self, int? dim=None, bool keepdim=False) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: argmin
- func: argmin.out(Tensor self, int? dim=None, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: argmin_out
- func: acosh(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: acosh
- func: acosh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: acosh_
- func: acosh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: acosh_out
# arccosh, alias for acosh
- func: arccosh(Tensor self) -> Tensor
variants: function, method
- func: arccosh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arccosh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: asinh(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: asinh
- func: asinh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: asinh_
- func: asinh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: asinh_out
# arcsinh, alias for asinh
- func: arcsinh(Tensor self) -> Tensor
variants: function, method
- func: arcsinh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arcsinh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: atanh(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: atanh
- func: atanh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: atanh_
- func: atanh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: atanh_out
# arctanh, alias for atanh
- func: arctanh(Tensor self) -> Tensor
variants: function, method
- func: arctanh_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arctanh.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: as_strided(Tensor(a) self, int[] size, int[] stride, int? storage_offset=None) -> Tensor(a)
variants: function, method
dispatch:
CPU, CUDA: as_strided_tensorimpl
QuantizedCPU, QuantizedCUDA: as_strided_qtensorimpl
device_guard: False
- func: as_strided_(Tensor(a!) self, int[] size, int[] stride, int? storage_offset=None) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function, method
device_guard: False
dispatch:
DefaultBackend: as_strided_
- func: asin(Tensor self) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: asin
SparseCPU, SparseCUDA: asin_sparse
- func: asin_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
CPU, CUDA: asin_
SparseCPU, SparseCUDA: asin_sparse_
- func: asin.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: asin_out
SparseCPU, SparseCUDA: asin_out_sparse
# arcsin, alias of asin
- func: arcsin(Tensor self) -> Tensor
variants: function, method
- func: arcsin_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arcsin.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: atan(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: atan
- func: atan_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: atan_
- func: atan.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: atan_out
# arctan, alias of atan
- func: arctan(Tensor self) -> Tensor
variants: function, method
- func: arctan_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
- func: arctan.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: atleast_1d(Tensor self) -> Tensor
variants: function
- func: atleast_1d.Sequence(Tensor[] tensors) -> Tensor[]
- func: atleast_2d(Tensor self) -> Tensor
variants: function
- func: atleast_2d.Sequence(Tensor[] tensors) -> Tensor[]
variants: function
- func: atleast_3d(Tensor self) -> Tensor
variants: function
- func: atleast_3d.Sequence(Tensor[] tensors) -> Tensor[]
variants: function
- func: baddbmm(Tensor self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1) -> Tensor
variants: function, method
dispatch:
CPU: baddbmm_cpu
CUDA: baddbmm_cuda
- func: baddbmm_(Tensor(a!) self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
variants: method
dispatch:
CPU: baddbmm__cpu
CUDA: baddbmm__cuda
- func: _baddbmm_mkl_(Tensor(a!) self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
variants: function
- func: baddbmm.out(Tensor self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
CPU: baddbmm_out_cpu
CUDA: baddbmm_out_cuda
- func: bartlett_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: bartlett_window.periodic(int window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- 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
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: quantized_batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor mean, Tensor var, float eps, float output_scale, int output_zero_point) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
QuantizedCPU: quantized_batch_norm
- 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)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- 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)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
# Sample bernoulli with values in `self` as probability.
- func: bernoulli(Tensor self, *, Generator? generator=None) -> Tensor
variants: function, method
dispatch:
DefaultBackend: bernoulli
- func: bernoulli.out(Tensor self, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
CPU, CUDA: bernoulli_out
- func: bernoulli_.Tensor(Tensor(a!) self, Tensor p, *, Generator? generator=None) -> Tensor(a!)
variants: method
dispatch:
CPU, CUDA: bernoulli_
- func: bernoulli_.float(Tensor(a!) self, float p=0.5, *, Generator? generator=None) -> Tensor(a!)
variants: method
dispatch:
CPU, CUDA: bernoulli_
# This out-of-place version isn't used explicitly, but needed by jit.
# There is no default valid on `p` here because it would introduce ambiguity
# with `bernoulli(Tensor self, *, Generator? generator=None)` declaration.
- func: bernoulli.p(Tensor self, float p, *, Generator? generator=None) -> Tensor
variants: function, method
- func: bilinear(Tensor input1, Tensor input2, Tensor weight, Tensor? bias) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: binary_cross_entropy(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
python_module: nn
variants: function
dispatch:
CPU: binary_cross_entropy_cpu
CUDA: binary_cross_entropy_cuda
- func: binary_cross_entropy.out(Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
python_module: nn
variants: function
dispatch:
CPU: binary_cross_entropy_out_cpu
CUDA: binary_cross_entropy_out_cuda
- func: binary_cross_entropy_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, int reduction=Mean) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
python_module: nn
variants: function
dispatch:
CPU: binary_cross_entropy_backward_cpu
CUDA: binary_cross_entropy_backward_cuda
- 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!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
python_module: nn
variants: function
dispatch:
CPU: binary_cross_entropy_backward_out_cpu
CUDA: binary_cross_entropy_backward_out_cuda
- func: binary_cross_entropy_with_logits(Tensor self, Tensor target, Tensor? weight=None, Tensor? pos_weight=None, int reduction=Mean) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
DefaultBackend: binary_cross_entropy_with_logits
- func: binary_cross_entropy_with_logits_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight=None, Tensor? pos_weight=None, int reduction=Mean) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
- func: bincount(Tensor self, Tensor? weights=None, int minlength=0) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function, method
dispatch:
CPU: _bincount_cpu
CUDA: _bincount_cuda
- func: bitwise_not(Tensor self) -> Tensor
variants: function, method
- func: bitwise_not_(Tensor(a!) self) -> Tensor(a!)
variants: method
- func: bitwise_not.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: bitwise_not_out
- func: copysign.Tensor(Tensor self, Tensor other) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: copysign
- func: copysign_.Tensor(Tensor(a!) self, Tensor other) -> Tensor(a!)
variants: method
dispatch:
CPU, CUDA: copysign_
- func: copysign.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: copysign_out
- func: copysign.Scalar(Tensor self, Scalar other) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: copysign
- func: copysign_.Scalar(Tensor(a!) self, Scalar other) -> Tensor(a!)
variants: method
dispatch:
CPU, CUDA: copysign_
- func: logical_not(Tensor self) -> Tensor
variants: function, method
- func: logical_not_(Tensor(a!) self) -> Tensor(a!)
variants: method
- func: logical_not.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: logical_not_out
- func: logical_xor(Tensor self, Tensor other) -> Tensor
variants: function, method
- func: logical_xor_(Tensor(a!) self, Tensor other) -> Tensor(a!)
variants: method
- func: logical_xor.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: logical_xor_out
- func: logical_and(Tensor self, Tensor other) -> Tensor
variants: function, method
- func: logical_and_(Tensor(a!) self, Tensor other) -> Tensor(a!)
variants: method
- func: logical_and.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: logical_and_out
- func: logical_or(Tensor self, Tensor other) -> Tensor
variants: function, method
- func: logical_or_(Tensor(a!) self, Tensor other) -> Tensor(a!)
variants: method
- func: logical_or.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: logical_or_out
- func: blackman_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: blackman_window.periodic(int window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: bmm(Tensor self, Tensor mat2) -> Tensor
variants: function, method
dispatch:
CPU: bmm_cpu
CUDA: bmm_cuda
SparseCPU: bmm_sparse_cpu
SparseCUDA: bmm_sparse_cuda
- func: _bmm(Tensor self, Tensor mat2, *, bool deterministic=False) -> Tensor
variants: function
dispatch:
SparseCUDA: _bmm_sparse_cuda
- func: bmm.out(Tensor self, Tensor mat2, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
CPU: bmm_out_cpu
CUDA: bmm_out_cuda
SparseCPU: bmm_out_sparse_cpu
SparseCUDA: bmm_out_sparse_cuda
- func: _bmm.out(Tensor self, Tensor mat2, *, bool deterministic=False, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
variants: function
dispatch:
SparseCUDA: _bmm_out_sparse_cuda
- func: broadcast_tensors(Tensor[] tensors) -> Tensor[]
device_guard: False
- func: broadcast_to(Tensor(a) self, int[] size) -> Tensor(a)
use_c10_dispatcher: full
variants: function, method
dispatch:
Math: broadcast_to
- func: cat(Tensor[] tensors, int dim=0) -> Tensor
dispatch:
DefaultBackend: cat
- func: cat.out(Tensor[] tensors, int dim=0, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
DefaultBackend: cat_out
- func: cat.names(Tensor[] tensors, Dimname dim) -> Tensor
- func: cat.names_out(Tensor[] tensors, Dimname dim, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
- func: block_diag(Tensor[] tensors) -> Tensor
variants: function
- func: ceil(Tensor self) -> Tensor
variants: function, method
dispatch:
DefaultBackend: ceil
- func: ceil_(Tensor(a!) self) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: ceil_
- func: ceil.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: ceil_out
- func: chain_matmul(Tensor[] matrices) -> Tensor
variants: function
- func: unsafe_chunk(Tensor self, int chunks, int dim=0) -> Tensor[]
variants: function, method
device_guard: False
- func: chunk(Tensor(a) self, int chunks, int dim=0) -> Tensor(a)[]
variants: function, method
device_guard: False
- func: tensor_split.sections(Tensor(a) self, int sections, int dim=0) -> Tensor(a)[]
variants: function, method
- func: tensor_split.indices(Tensor(a) self, int[] indices, int dim=0) -> Tensor(a)[]
variants: function, method
- func: tensor_split.tensor_indices_or_sections(Tensor(a) self, Tensor tensor_indices_or_sections, int dim=0) -> Tensor(a)[]
use_c10_dispatcher: full
variants: function, method
- func: clamp(Tensor self, Scalar? min=None, Scalar? max=None) -> Tensor
variants: function, method
dispatch:
CPU, CUDA: clamp
QuantizedCPU: clamp_quantized_cpu
- func: clamp_(Tensor(a!) self, Scalar? min=None, Scalar? max=None) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: clamp_
- func: clamp.out(Tensor self, Scalar? min=None, Scalar? max=None, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: clamp_out
- func: clamp_max(Tensor self, Scalar max) -> Tensor
variants: function, method
dispatch:
DefaultBackend: clamp_max
- func: clamp_max_(Tensor(a!) self, Scalar max) -> Tensor(a!)
variants: function, method
dispatch:
DefaultBackend: clamp_max_
- func: clamp_max.out(Tensor self, Scalar max, *, Tensor(a!) out) -> Tensor(a!)
use_c10_dispatcher: hacky_wrapper_for_legacy_signatures
dispatch:
CPU, CUDA: clamp_max_out
- func: clamp_min(Tensor self, Scalar min) -> Tensor