forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnative_functions.yaml
4801 lines (3672 loc) · 176 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
# Temporary type cast operators. These are needed to trace type-casts now since
# Type's are not supported in the IR. Instead, we call down to these
# specialized operators for each datatype.
# TODO: remove when we have Type support in the IR
- func: _cast_Byte(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Char(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Double(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Float(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Int(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Long(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Short(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cast_Half(Tensor self, bool non_blocking=False) -> Tensor
matches_jit_signature: True
variants: function
- func: _cudnn_ctc_loss(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank, bool deterministic, bool zero_infinity) -> (Tensor, Tensor)
matches_jit_signature: True
dispatch:
CUDA: _cudnn_ctc_loss
- 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
matches_jit_signature: True
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 num_layers, bool batch_first, float dropout, bool train, bool bidirectional, int[] batch_sizes, BoolTensor? dropout_state) -> (Tensor, Tensor, Tensor, Tensor, Tensor)
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 num_layers, bool batch_first, float dropout, bool train, bool bidirectional, int[] batch_sizes, BoolTensor? dropout_state, Tensor reserve, bool[4] output_mask) -> (Tensor, Tensor, Tensor, Tensor[])
dispatch:
CUDA: _cudnn_rnn_backward
- func: _cudnn_init_dropout_state(float dropout, bool train, int dropout_seed, TensorOptions options) -> Tensor
dispatch:
CUDA: _cudnn_init_dropout_state
- func: _fused_dropout(Tensor self, float p, Generator? generator=None) -> (Tensor, Tensor)
matches_jit_signature: True
variants: function
dispatch:
CUDA: fused_dropout_cuda
- func: _masked_scale(Tensor self, Tensor mask, float scale) -> Tensor
matches_jit_signature: True
variants: function
dispatch:
CUDA: masked_scale_cuda
- func: _reshape_from_tensor(Tensor self, Tensor shape) -> Tensor
matches_jit_signature: True
- func: _shape_as_tensor(Tensor self) -> Tensor
matches_jit_signature: True
- func: dropout(Tensor input, float p, bool train) -> Tensor
matches_jit_signature: True
- func: dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
matches_jit_signature: True
- func: feature_dropout(Tensor input, float p, bool train) -> Tensor
matches_jit_signature: True
- func: feature_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
matches_jit_signature: True
- func: alpha_dropout(Tensor input, float p, bool train) -> Tensor
matches_jit_signature: True
- func: alpha_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
matches_jit_signature: True
- func: feature_alpha_dropout(Tensor input, float p, bool train) -> Tensor
matches_jit_signature: True
- func: feature_alpha_dropout_(Tensor(a!) self, float p, bool train) -> Tensor(a!)
matches_jit_signature: True
- func: abs(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: abs_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _abs__cpu
CUDA: _abs__cuda
- func: abs(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _abs_out_cpu
CUDA: _abs_out_cuda
- func: acos(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: acos_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _acos__cpu
CUDA: _acos__cuda
- func: acos(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _acos_out_cpu
CUDA: _acos_out_cuda
- 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
matches_jit_signature: True
- func: adaptive_avg_pool1d(Tensor self, int[1] output_size) -> Tensor
matches_jit_signature: True
# Return: (Tensor output, Tensor indices)
- func: adaptive_max_pool1d(Tensor self, int[1] output_size) -> (Tensor, Tensor)
matches_jit_signature: True
- func: add(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: add_(Tensor(a!) self, Tensor other, *, Scalar alpha=1) -> Tensor(a!)
matches_jit_signature: True
variants: method
- func: add(Tensor self, Tensor other, *, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
# For C++ only, until we have conversion from C++ numbers to Tensor
- func: add(Tensor self, Scalar other, Scalar alpha=1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: add_(Tensor(a!) self, Scalar other, Scalar alpha=1) -> Tensor(a!)
matches_jit_signature: True
variants: method
- func: addmv(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: addmv_(Tensor(a!) self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
- func: addmv(Tensor self, Tensor mat, Tensor vec, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: addr(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: addr_(Tensor(a!) self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1) -> Tensor(a!)
matches_jit_signature: True
variants: method
- func: addr(Tensor self, Tensor vec1, Tensor vec2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: affine_grid_generator(Tensor theta, int[] size) -> Tensor
matches_jit_signature: True
variants: function
- func: affine_grid_generator_backward(Tensor grad, int[] size) -> Tensor
matches_jit_signature: True
variants: function
- func: all(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function, method
- func: all(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: allclose(Tensor self, Tensor other, float rtol=1e-05, float atol=1e-08, bool equal_nan=False) -> bool
matches_jit_signature: True
variants: function, method
- func: any(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function, method
- func: any(Tensor self, int dim, bool keepdim=False, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: arange(Scalar end, TensorOptions options=[]) -> Tensor
- func: arange(Scalar start, Scalar end, TensorOptions options=[]) -> Tensor
- func: arange(Scalar start, Scalar end, Scalar step, TensorOptions options=[]) -> Tensor
- func: arange(Scalar end, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: arange(Scalar start, Scalar end, Scalar step=1, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
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
matches_jit_signature: True
# `argmin` and `argmax` are exposed in C++ but not in Python, where we only
# expose `_argmin` and `_argmax` (which call the first versions). In Python, we
# then define our own `argmax` and `argmin` that handle passing `dim=None`,
# which gets the argmax/argmin of the flattened array.
- func: argmax(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function, method
- func: argmax(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: _argmax(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function
- func: argmin(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function, method
- func: argmin(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: _argmin(Tensor self, int dim, bool keepdim=False) -> Tensor
matches_jit_signature: True
variants: function
- func: as_strided(Tensor(a) self, int[] size, int[] stride, int? storage_offset=None) -> Tensor(a)
matches_jit_signature: True
variants: function, method
device_guard: False
- func: as_strided_(Tensor(a!) self, int[] size, int[] stride, int? storage_offset=None) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
device_guard: False
- func: asin(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: asin_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _asin__cpu
CUDA: _asin__cuda
- func: asin(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _asin_out_cpu
CUDA: _asin_out_cuda
- func: atan(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: atan_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _atan__cpu
CUDA: _atan__cuda
- func: atan(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _atan_out_cpu
CUDA: _atan_out_cuda
- func: baddbmm(Tensor self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1) -> Tensor
matches_jit_signature: True
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!)
matches_jit_signature: True
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!)
matches_jit_signature: True
variants: function
- func: baddbmm(Tensor self, Tensor batch1, Tensor batch2, *, Scalar beta=1, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
variants: function
dispatch:
CPU: baddbmm_out_cpu
CUDA: baddbmm_out_cuda
- func: bartlett_window(int window_length, TensorOptions options=[]) -> Tensor
- func: bartlett_window(int window_length, bool periodic, TensorOptions options=[]) -> Tensor
- 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
matches_jit_signature: True
- 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, int64_t)
- func: _batch_norm_impl_index_backward(int64_t 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, std::array<bool,3> output_mask) -> (Tensor, Tensor, Tensor)
# Sample bernoulli with values in `self` as probability.
- func: bernoulli(Tensor self, *, Generator? generator=None) -> Tensor
matches_jit_signature: True
variants: function, method
- func: bernoulli(Tensor self, *, Generator? generator=None, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
variants: function
- func: bernoulli_(Tensor(a!) self, Tensor p, *, Generator? generator=None) -> Tensor(a!)
matches_jit_signature: True
variants: method
dispatch:
CPU: bernoulli_tensor_cpu_
CUDA: bernoulli_tensor_cuda_
- func: bernoulli_(Tensor(a!) self, float p=0.5, *, Generator? generator=None) -> Tensor(a!)
matches_jit_signature: True
variants: method
dispatch:
CPU: bernoulli_scalar_cpu_
CUDA: bernoulli_scalar_cuda_
# 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(Tensor self, float p, *, Generator? generator=None) -> Tensor
matches_jit_signature: True
variants: function, method
- func: bilinear(Tensor input1, Tensor input2, Tensor weight, Tensor? bias) -> Tensor
matches_jit_signature: True
- func: binary_cross_entropy_with_logits(Tensor self, Tensor target, Tensor? weight, Tensor? pos_weight, int reduction) -> Tensor
matches_jit_signature: True
variants: function
- func: binary_cross_entropy_with_logits_backward(Tensor grad_output, Tensor self, Tensor target, Tensor? weight, Tensor? pos_weight, int reduction) -> Tensor
matches_jit_signature: True
variants: function
- func: bincount(Tensor self, Tensor? weights=None, int minlength=0) -> Tensor
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _bincount_cpu
CUDA: _bincount_cuda
- func: blackman_window(int window_length, TensorOptions options=[]) -> Tensor
- func: blackman_window(int window_length, bool periodic, TensorOptions options=[]) -> Tensor
- func: bmm(Tensor self, Tensor mat2) -> Tensor
matches_jit_signature: True
variants: function, method
dispatch:
CPU: bmm_cpu
CUDA: bmm_cuda
- func: bmm(Tensor self, Tensor mat2, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
variants: function
dispatch:
CPU: bmm_out_cpu
CUDA: bmm_out_cuda
- func: broadcast_tensors(Tensor[] tensors) -> Tensor[]
matches_jit_signature: True
device_guard: False
- func: cat(Tensor[] tensors, int dim=0) -> Tensor
matches_jit_signature: True
- func: cat(Tensor[] tensors, int dim=0, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: ceil(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: ceil_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _ceil__cpu
CUDA: _ceil__cuda
- func: ceil(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _ceil_out_cpu
CUDA: _ceil_out_cuda
- func: chain_matmul(Tensor[] matrices) -> Tensor
matches_jit_signature: True
variants: function
- func: chunk(Tensor(a) self, int chunks, int dim=0) -> Tensor(a)[]
matches_jit_signature: True
variants: function, method
device_guard: False
- func: clamp(Tensor self, Scalar? min=None, Scalar? max=None) -> Tensor
matches_jit_signature: True
variants: function, method
- func: clamp_(Tensor(a!) self, Scalar? min=None, Scalar? max=None) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _clamp__cpu
CUDA: _clamp__cuda
- func: clamp(Tensor self, Scalar? min=None, Scalar? max=None, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _clamp_out_cpu
CUDA: _clamp_out_cuda
- func: clamp_max(Tensor self, Scalar max) -> Tensor
matches_jit_signature: True
variants: function, method
- func: clamp_max_(Tensor(a!) self, Scalar max) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _clamp_max__cpu
CUDA: _clamp_max__cuda
- func: clamp_max(Tensor self, Scalar max, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _clamp_max_out_cpu
CUDA: _clamp_max_out_cuda
- func: clamp_min(Tensor self, Scalar min) -> Tensor
matches_jit_signature: True
variants: function, method
- func: clamp_min_(Tensor(a!) self, Scalar min) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _clamp_min__cpu
CUDA: _clamp_min__cuda
- func: clamp_min(Tensor self, Scalar min, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _clamp_min_out_cpu
CUDA: _clamp_min_out_cuda
- func: cudnn_is_acceptable(Tensor self) -> bool
matches_jit_signature: True
device_guard: False
- func: constant_pad_nd(Tensor self, int[] pad, Scalar value=0) -> Tensor
matches_jit_signature: True
variants: function
- func: contiguous(Tensor self) -> Tensor
matches_jit_signature: True
variants: method
- func: convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups) -> Tensor
matches_jit_signature: True
- func: _convolution(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups, bool benchmark, bool deterministic, bool cudnn_enabled) -> Tensor
matches_jit_signature: True
- func: _convolution_nogroup(Tensor input, Tensor weight, Tensor? bias, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding) -> Tensor
matches_jit_signature: True
- func: _convolution_double_backward(Tensor? ggI, Tensor? ggW, Tensor? ggb, Tensor gO, Tensor weight, Tensor self, int[] stride, int[] padding, int[] dilation, bool transposed, int[] output_padding, int groups, bool benchmark, bool deterministic, bool cudnn_enabled, bool[3] output_mask) -> (Tensor, Tensor, Tensor)
matches_jit_signature: True
- func: conv1d(Tensor input, Tensor weight, Tensor? bias=None, int[1] stride=1, int[1] padding=0, int[1] dilation=1, int groups=1) -> Tensor
matches_jit_signature: True
- func: conv2d(Tensor input, Tensor weight, Tensor? bias=None, int[2] stride=1, int[2] padding=0, int[2] dilation=1, int groups=1) -> Tensor
matches_jit_signature: True
- func: conv3d(Tensor input, Tensor weight, Tensor? bias=None, int[3] stride=1, int[3] padding=0, int[3] dilation=1, int groups=1) -> Tensor
matches_jit_signature: True
- func: conv_tbc(Tensor self, Tensor weight, Tensor bias, int pad=0) -> Tensor
matches_jit_signature: True
- func: conv_tbc_backward(Tensor self, Tensor input, Tensor weight, Tensor bias, int pad) -> (Tensor, Tensor, Tensor)
matches_jit_signature: True
# NB: we inherit the goofy argument order from PyTorch torch.nn.functional
- func: conv_transpose1d(Tensor input, Tensor weight, Tensor? bias=None, int[1] stride=1, int[1] padding=0, int[1] output_padding=0, int groups=1, int[1] dilation=1) -> Tensor
matches_jit_signature: True
- func: conv_transpose2d(Tensor input, Tensor weight, Tensor? bias=None, int[2] stride=1, int[2] padding=0, int[2] output_padding=0, int groups=1, int[2] dilation=1) -> Tensor
matches_jit_signature: True
- func: conv_transpose3d(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
matches_jit_signature: True
- func: s_copy_(Tensor(a!) self, Tensor src, bool non_blocking=False) -> Tensor(a!)
matches_jit_signature: True
cpu_half: True
dispatch:
CPU: _s_copy__cpu
CUDA: _s_copy__cuda
- func: _s_copy_from(Tensor self, Tensor dst, bool non_blocking=False) -> Tensor
matches_jit_signature: True
cpu_half: True
dispatch:
CUDA: _s_copy_from_cuda
- func: _copy_same_type_(Tensor(a!) self, Tensor src) -> void
cpu_half: True
dispatch:
CPU: _copy_same_type__cpu
- func: cos(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cos_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _cos__cpu
CUDA: _cos__cuda
- func: cos(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _cos_out_cpu
CUDA: _cos_out_cuda
- func: cosh(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cosh_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _cosh__cpu
CUDA: _cosh__cuda
- func: cosh(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _cosh_out_cpu
CUDA: _cosh_out_cuda
- func: cosine_embedding_loss(Tensor input1, Tensor input2, Tensor target, float margin=0.0, int reduction=Mean) -> Tensor
matches_jit_signature: True
- func: cudnn_affine_grid_generator(Tensor theta, int N, int C, int H, int W) -> Tensor grid
dispatch:
CUDA: cudnn_affine_grid_generator_forward
# TODO: Why do I have to call this grad?!
- func: cudnn_affine_grid_generator_backward(Tensor grad, int N, int C, int H, int W) -> Tensor grad_theta
dispatch:
CUDA: cudnn_affine_grid_generator_backward
- func: cudnn_batch_norm(Tensor input, Tensor weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float exponential_average_factor, float epsilon) -> (Tensor, Tensor, Tensor)
matches_jit_signature: True
dispatch:
CUDA: cudnn_batch_norm
# NB: You can only use this if you used cudnn_batch_norm training=True
- func: cudnn_batch_norm_backward(Tensor input, Tensor grad_output, Tensor weight, Tensor? running_mean, Tensor? running_var, Tensor? save_mean, Tensor? save_var, float epsilon) -> (Tensor, Tensor, Tensor)
matches_jit_signature: True
dispatch:
CUDA: cudnn_batch_norm_backward
- func: cudnn_convolution(Tensor self, Tensor weight, Tensor? bias, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution
- func: cudnn_convolution_backward_input(int[] self_size, Tensor grad_output, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_backward_input
- 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)
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_backward
- func: cudnn_convolution_backward_bias(Tensor grad_output) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_backward_bias
- 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
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_backward_weight
- 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
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_transpose
# NB: output_padding not strictly needed here, but it's helpful for the float
# backwards
- 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)
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_transpose_backward
- func: cudnn_convolution_transpose_backward_bias(Tensor grad_output) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_backward_bias
- func: cudnn_convolution_transpose_backward_input(Tensor grad_output, Tensor weight, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_transpose_backward_input
- func: cudnn_convolution_transpose_backward_weight(int[] weight_size, Tensor grad_output, Tensor self, int[] padding, int[] stride, int[] dilation, int groups, bool benchmark, bool deterministic) -> Tensor
matches_jit_signature: True
dispatch:
CUDA: cudnn_convolution_transpose_backward_weight
# NB: input is special cased in a way I don't quite understand
- func: cudnn_grid_sampler(Tensor self, Tensor grid) -> Tensor output
dispatch:
CUDA: cudnn_grid_sampler_forward
- func: cudnn_grid_sampler_backward(Tensor self, Tensor grid, Tensor grad_output) -> (Tensor grad_self, Tensor grad_grid)
matches_jit_signature: True
dispatch:
CUDA: cudnn_grid_sampler_backward
# FIXME: These could be combined as optional<ScalarType> but for https://github.com/pytorch/pytorch/issues/6593.
- func: cumsum(Tensor self, int dim, *, ScalarType dtype) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cumsum(Tensor self, int dim) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cumsum(Tensor self, int dim, *, ScalarType dtype, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: cumsum(Tensor self, int dim, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
# FIXME: These could be combined as optional<ScalarType> but for https://github.com/pytorch/pytorch/issues/6593.
- func: cumprod(Tensor self, int dim, *, ScalarType dtype) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cumprod(Tensor self, int dim) -> Tensor
matches_jit_signature: True
variants: function, method
- func: cumprod(Tensor self, int dim, *, ScalarType dtype, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: cumprod(Tensor self, int dim, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: ctc_loss(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank=0, int reduction=Mean, bool zero_infinity=False) -> Tensor
matches_jit_signature: True
# convenience function that converts to intlists for you
- func: ctc_loss(Tensor log_probs, Tensor targets, Tensor input_lengths, Tensor target_lengths, int blank=0, int reduction=Mean, bool zero_infinity=False) -> Tensor
matches_jit_signature: True
- func: _ctc_loss(Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, int blank=0, bool zero_infinity=False) -> (Tensor, Tensor)
matches_jit_signature: True
dispatch:
CPU: ctc_loss_cpu
CUDA: ctc_loss_gpu
- func: _ctc_loss_backward(Tensor grad, Tensor log_probs, Tensor targets, int[] input_lengths, int[] target_lengths, Tensor neg_log_likelihood, Tensor log_alpha, int blank, bool zero_infinity=False) -> Tensor
matches_jit_signature: True
dispatch:
CPU: ctc_loss_backward_cpu
CUDA: ctc_loss_backward_gpu
- func: det(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: diag_embed(Tensor self, int offset=0, int dim1=-2, int dim2=-1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: diagflat(Tensor self, int offset=0) -> Tensor
matches_jit_signature: True
variants: function, method
- func: diagonal(Tensor(a) self, int offset=0, int dim1=0, int dim2=1) -> Tensor(a)
matches_jit_signature: True
variants: function, method
- func: div(Tensor self, Tensor other) -> Tensor
matches_jit_signature: True
variants: function, method
- func: div_(Tensor(a!) self, Tensor other) -> Tensor(a!)
matches_jit_signature: True
variants: method
- func: div(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
# For C++ only, until we have conversion from C++ numbers to Tensor
- func: div(Tensor self, Scalar other) -> Tensor
matches_jit_signature: True
variants: function, method
- func: div_(Tensor(a!) self, Scalar other) -> Tensor(a!)
matches_jit_signature: True
variants: method
- func: dot(Tensor self, Tensor tensor) -> Tensor
matches_jit_signature: True
variants: function, method
- func: dot(Tensor self, Tensor tensor, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: einsum(str equation, Tensor[] tensors) -> Tensor
matches_jit_signature: True
- func: embedding(Tensor weight, IndexTensor indices, int padding_idx=-1, bool scale_grad_by_freq=False, bool sparse=False) -> Tensor
- func: embedding_backward(Tensor grad, IndexTensor indices, int num_weights, int padding_idx, bool scale_grad_by_freq, bool sparse) -> Tensor
- func: embedding_dense_backward(Tensor grad, IndexTensor indices, int num_weights, int padding_idx, bool scale_grad_by_freq) -> Tensor
dispatch:
CPU: embedding_dense_backward_cpu
CUDA: embedding_dense_backward_cuda
- func: embedding_renorm_(Tensor(a!) self, IndexTensor indices, float max_norm, float norm_type) -> Tensor(a!)
dispatch:
CPU: embedding_renorm_cpu_
CUDA: embedding_renorm_cuda_
- func: embedding_sparse_backward(Tensor grad, IndexTensor indices, int num_weights, int padding_idx, bool scale_grad_by_freq) -> Tensor
# NOTE [ embedding_bag Native Functions ]
# The `_embedding_bag.*` variants assume that input tensors except for `weight`,
# e.g. `indices` and `offsets` (and `offset2bag`), are contiguous.
# We really only need to enforce this for `_embedding_bag` (the forward) because
# the backward inputs are the same as forward ones.
# The above `embedding_bag` wrapper is created to achieve this, e.g.,
# applying indices = indices.contiguous().
# The backward functions apply a check that these input tensors are contiguous.
- func: embedding_bag(Tensor weight, IndexTensor indices, IndexTensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False) -> (Tensor, Tensor, Tensor, Tensor)
- func: _embedding_bag(Tensor weight, IndexTensor indices, IndexTensor offsets, bool scale_grad_by_freq=False, int mode=0, bool sparse=False) -> (Tensor, Tensor, Tensor, Tensor)
dispatch:
CPU: _embedding_bag_cpu
CUDA: _embedding_bag_cuda
- func: _embedding_bag_backward(Tensor grad, IndexTensor indices, IndexTensor offsets, IndexTensor offset2bag, IndexTensor bag_size, IndexTensor maximum_indices, int num_weights, bool scale_grad_by_freq, int mode, bool sparse) -> Tensor
- func: _embedding_bag_sparse_backward(Tensor grad, IndexTensor indices, IndexTensor offsets, IndexTensor offset2bag, IndexTensor bag_size, int num_weights, bool scale_grad_by_freq, int mode) -> Tensor
- func: _embedding_bag_dense_backward(Tensor grad, IndexTensor indices, IndexTensor offsets, IndexTensor offset2bag, IndexTensor bag_size, IndexTensor maximum_indices, int num_weights, bool scale_grad_by_freq, int mode) -> Tensor
dispatch:
CPU: _embedding_bag_dense_backward_cpu
CUDA: _embedding_bag_dense_backward_cuda
- func: empty(int[] size, TensorOptions options=[]) -> Tensor
cpu_half: True
dispatch:
CPU: empty_cpu
CUDA: empty_cuda
SparseCPU: empty_sparse
SparseCUDA: empty_sparse
- func: resize_(Tensor(a!) self, int[] size) -> Tensor(a!)
matches_jit_signature: True
variants: method
cpu_half: True
device_guard: False
dispatch:
CPU: resize_cpu_
CUDA: resize_cuda_
- func: empty(int[] size, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
device_guard: False
- func: empty_like(Tensor self) -> Tensor
matches_jit_signature: True
device_guard: False
- func: empty_like(Tensor self, *, TensorOptions options) -> Tensor
device_guard: False
- func: empty_strided(int[] size, int[] stride, *, TensorOptions options=[]) -> Tensor
dispatch:
CPU: empty_strided_cpu
CUDA: empty_strided_cuda
- func: erf(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: erf_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _erf__cpu
CUDA: _erf__cuda
- func: erf(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _erf_out_cpu
CUDA: _erf_out_cuda
- func: erfc(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: erfc_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _erfc__cpu
CUDA: _erfc__cuda
- func: erfc(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _erfc_out_cpu
CUDA: _erfc_out_cuda
- func: exp(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: exp_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _exp__cpu
CUDA: _exp__cuda
- func: exp(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _exp_out_cpu
CUDA: _exp_out_cuda
- func: expm1(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: expm1_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _expm1__cpu
CUDA: _expm1__cuda
- func: expm1(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _expm1_out_cpu
CUDA: _expm1_out_cuda
- func: expand(Tensor(a) self, int[] size, *, bool implicit=False) -> Tensor(a)
matches_jit_signature: True
variants: method # This is method-only to match the previous tensor API. In the future we could make this a function too.
device_guard: False
- func: expand_as(Tensor self, Tensor other) -> Tensor
matches_jit_signature: True
variants: method # This is method-only to match the previous tensor API. In the future we could make this a function too.
device_guard: False
- func: eye(int n, TensorOptions options=[]) -> Tensor
- func: eye(int n, int m, TensorOptions options=[]) -> Tensor
- func: eye(int n, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: eye_out_cpu
CUDA: eye_out_cuda
- func: eye(int n, int m, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: eye_out_cpu
CUDA: eye_out_cuda
- func: flatten(Tensor self, int start_dim=0, int end_dim=-1) -> Tensor
matches_jit_signature: True
variants: function, method
- func: fill_(Tensor(a!) self, Scalar value) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
- func: fill_(Tensor(a!) self, Tensor value) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
- func: floor(Tensor self) -> Tensor
matches_jit_signature: True
variants: function, method
- func: floor_(Tensor(a!) self) -> Tensor(a!)
matches_jit_signature: True
variants: function, method
dispatch:
CPU: _floor__cpu
CUDA: _floor__cuda
- func: floor(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
dispatch:
CPU: _floor_out_cpu
CUDA: _floor_out_cuda
- func: full(int[] size, Scalar fill_value, TensorOptions options=[]) -> Tensor
- func: full(int[] size, Scalar fill_value, *, Tensor(a!) out) -> Tensor(a!)
matches_jit_signature: True
- func: full_like(Tensor self, Scalar fill_value) -> Tensor
matches_jit_signature: True
- func: full_like(Tensor self, Scalar fill_value, *, TensorOptions options) -> Tensor
# NOTE [ grid_sampler Native Functions ]
# `grid_sampler` does all the shape checking and then dispatches to one of
# `cudnn_grid_sampler`, `grid_sampler_2d`, or `grid_sampler_3d`, each of which
# has the corresponding backward defined as native functions as well. Therefore,
# in these functions and their backwards, no more shape checking is done.
#
# Additionally, arguments `padding_mode` and `interpolation_mode` are cast to
# enums defined in `native/GridSampler.h`. `cudnn_grid_sampler` doesn't take in
# `interpolation_mode` because it only supports Bilinear interpolation mode.
- func: grid_sampler(Tensor input, Tensor grid, int interpolation_mode, int padding_mode) -> Tensor
matches_jit_signature: True