-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.h
6074 lines (5096 loc) · 173 KB
/
Functions.h
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
#pragma once
// @generated from tools/autograd/templates/Functions.h
#include <ATen/ATen.h>
#include <ATen/core/functional.h>
#include <ATen/TensorGeometry.h>
#include "torch/csrc/THP_export.h"
#include "torch/csrc/autograd/function.h"
#include "torch/csrc/autograd/variable.h"
#include "torch/csrc/autograd/saved_variable.h"
#include <torch/csrc/WindowsTorchApiMacro.h>
namespace torch { namespace autograd { namespace generated {
using at::Scalar;
using at::Tensor;
using at::IntArrayRef;
using at::Type;
using at::TensorGeometry;
using at::ScalarType;
using c10::optional;
using c10::fmap;
inline std::vector<Tensor> unpack_list(at::ArrayRef<SavedVariable> xs) {
// NB: we must explicitly do the conversion in the lambda, otherwise template
// deduction will give a Tensor of Variable which is not convertible
return fmap(xs, [](const SavedVariable& x) {
return static_cast<Tensor>(x.unpack());
});
}
struct TypeAndSize {
TypeAndSize() : options(at::TensorOptions()) {}
/* implicit */
TypeAndSize(const Tensor & t)
: sizes(t.sizes().vec())
, options(t.options()) {}
Tensor zeros() { return at::zeros(sizes, options); }
private:
std::vector<int64_t> sizes;
at::TensorOptions options;
};
struct TORCH_API AbsBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AbsBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API AcosBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AcosBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API AddBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddBackward0"; }
void release_variables() override {
}
Scalar alpha;
};
struct TORCH_API AddBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddBackward1"; }
void release_variables() override {
}
};
struct TORCH_API AddbmmBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddbmmBackward"; }
void release_variables() override {
batch2_.reset_data();
batch2_.reset_grad_function();
batch1_.reset_data();
batch1_.reset_grad_function();
}
int64_t batch1_argsize_0 = 0;
int64_t batch1_argsize_1 = 0;
int64_t batch2_argsize_2 = 0;
SavedVariable batch2_;
Scalar alpha;
SavedVariable batch1_;
Scalar beta;
};
struct TORCH_API AddcdivBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddcdivBackward"; }
void release_variables() override {
tensor2_.reset_data();
tensor2_.reset_grad_function();
tensor1_.reset_data();
tensor1_.reset_grad_function();
}
SavedVariable tensor2_;
Scalar value;
SavedVariable tensor1_;
};
struct TORCH_API AddcmulBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddcmulBackward"; }
void release_variables() override {
tensor2_.reset_data();
tensor2_.reset_grad_function();
tensor1_.reset_data();
tensor1_.reset_grad_function();
}
SavedVariable tensor2_;
Scalar value;
SavedVariable tensor1_;
};
struct TORCH_API AddmmBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddmmBackward"; }
void release_variables() override {
mat1_.reset_data();
mat1_.reset_grad_function();
mat2_.reset_data();
mat2_.reset_grad_function();
}
SavedVariable mat1_;
SavedVariable mat2_;
Scalar alpha;
std::vector<int64_t> mat2_sizes;
Scalar beta;
};
struct TORCH_API SparseAddmmBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "SparseAddmmBackward"; }
void release_variables() override {
sparse_.reset_data();
sparse_.reset_grad_function();
dense_.reset_data();
dense_.reset_grad_function();
}
SavedVariable sparse_;
std::vector<int64_t> dense_sizes;
SavedVariable dense_;
Scalar alpha;
Scalar beta;
};
struct TORCH_API AddmvBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddmvBackward"; }
void release_variables() override {
vec_.reset_data();
vec_.reset_grad_function();
mat_.reset_data();
mat_.reset_grad_function();
}
SavedVariable vec_;
Scalar alpha;
Scalar beta;
SavedVariable mat_;
};
struct TORCH_API AddrBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AddrBackward"; }
void release_variables() override {
vec2_.reset_data();
vec2_.reset_grad_function();
vec1_.reset_data();
vec1_.reset_grad_function();
}
Scalar beta;
SavedVariable vec2_;
Scalar alpha;
SavedVariable vec1_;
};
struct TORCH_API AffineGridGeneratorBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AffineGridGeneratorBackward"; }
void release_variables() override {
}
std::vector<int64_t> size;
bool align_corners;
};
struct TORCH_API AliasBackward : public Node {
using Node::Node;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AliasBackward"; }
void release_variables() override {
}
};
struct TORCH_API AngleBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AngleBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
ScalarType self_scalar_type;
SavedVariable self_;
};
struct TORCH_API AnyBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AnyBackward0"; }
void release_variables() override {
}
};
struct TORCH_API AnyBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AnyBackward1"; }
void release_variables() override {
}
};
struct TORCH_API AllBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AllBackward0"; }
void release_variables() override {
}
};
struct TORCH_API AllBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AllBackward1"; }
void release_variables() override {
}
};
struct TORCH_API AsStridedBackward : public Node {
using Node::Node;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AsStridedBackward"; }
void release_variables() override {
}
TensorGeometry self_geometry;
std::vector<int64_t> size;
std::vector<int64_t> stride;
c10::optional<int64_t> storage_offset;
};
struct TORCH_API AsinBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AsinBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API AtanBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "AtanBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API Atan2Backward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "Atan2Backward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
other_.reset_data();
other_.reset_grad_function();
}
SavedVariable self_;
SavedVariable other_;
};
struct TORCH_API BaddbmmBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "BaddbmmBackward"; }
void release_variables() override {
batch2_.reset_data();
batch2_.reset_grad_function();
batch1_.reset_data();
batch1_.reset_grad_function();
}
SavedVariable batch2_;
Scalar alpha;
SavedVariable batch1_;
Scalar beta;
};
struct TORCH_API BernoulliBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "BernoulliBackward0"; }
void release_variables() override {
}
};
struct TORCH_API BernoulliBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "BernoulliBackward1"; }
void release_variables() override {
}
TypeAndSize p_info;
};
struct TORCH_API BernoulliBackward2 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "BernoulliBackward2"; }
void release_variables() override {
}
};
struct TORCH_API BmmBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "BmmBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
mat2_.reset_data();
mat2_.reset_grad_function();
}
SavedVariable self_;
SavedVariable mat2_;
};
struct TORCH_API CatBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CatBackward"; }
void release_variables() override {
}
std::vector<std::vector<int64_t>> tensors_args_sizes;
int64_t dim = 0;
size_t tensors_size_;
};
struct TORCH_API CauchyBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CauchyBackward"; }
void release_variables() override {
}
};
struct TORCH_API CeilBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CeilBackward"; }
void release_variables() override {
}
};
struct TORCH_API CholeskyBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CholeskyBackward"; }
void release_variables() override {
result_.reset_data();
result_.reset_grad_function();
}
bool upper;
SavedVariable result_;
};
struct TORCH_API CholeskySolveBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CholeskySolveBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
input2_.reset_data();
input2_.reset_grad_function();
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable self_;
SavedVariable input2_;
bool upper;
SavedVariable result_;
};
struct TORCH_API CholeskyInverseBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CholeskyInverseBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable self_;
bool upper;
SavedVariable result_;
};
struct TORCH_API ClampBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ClampBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
c10::optional<Scalar> min;
c10::optional<Scalar> max;
};
struct TORCH_API ClampMinBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ClampMinBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
Scalar min;
};
struct TORCH_API ClampMaxBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ClampMaxBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
Scalar max;
};
struct TORCH_API CloneBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CloneBackward"; }
void release_variables() override {
}
};
struct TORCH_API CoalesceBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CoalesceBackward"; }
void release_variables() override {
}
};
struct TORCH_API ConjBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ConjBackward"; }
void release_variables() override {
}
};
struct TORCH_API CosBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CosBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API CoshBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CoshBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API CrossBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CrossBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
other_.reset_data();
other_.reset_grad_function();
}
SavedVariable self_;
c10::optional<int64_t> dim;
SavedVariable other_;
};
struct TORCH_API CumprodBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CumprodBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
ScalarType self_scalar_type;
SavedVariable self_;
int64_t dim = 0;
};
struct TORCH_API CumsumBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CumsumBackward"; }
void release_variables() override {
}
ScalarType self_scalar_type;
int64_t dim = 0;
};
struct TORCH_API CummaxBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CummaxBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
indices_.reset_data();
indices_.reset_grad_function();
}
ScalarType self_scalar_type;
SavedVariable self_;
int64_t dim = 0;
SavedVariable indices_;
};
struct TORCH_API CumminBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CumminBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
indices_.reset_data();
indices_.reset_grad_function();
}
ScalarType self_scalar_type;
SavedVariable self_;
int64_t dim = 0;
SavedVariable indices_;
};
struct TORCH_API ConvTbcBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ConvTbcBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
weight_.reset_data();
weight_.reset_grad_function();
bias_.reset_data();
bias_.reset_grad_function();
}
SavedVariable self_;
SavedVariable weight_;
SavedVariable bias_;
int64_t pad = 0;
};
struct TORCH_API CtcLossBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "CtcLossBackward"; }
void release_variables() override {
log_probs_.reset_data();
log_probs_.reset_grad_function();
targets_.reset_data();
targets_.reset_grad_function();
result0_.reset_data();
result0_.reset_grad_function();
result1_.reset_data();
result1_.reset_grad_function();
}
SavedVariable log_probs_;
SavedVariable targets_;
std::vector<int64_t> input_lengths;
std::vector<int64_t> target_lengths;
int64_t blank = 0;
bool zero_infinity;
SavedVariable result0_;
SavedVariable result1_;
};
struct TORCH_API DetBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DetBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable self_;
SavedVariable result_;
};
struct TORCH_API DiagBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DiagBackward"; }
void release_variables() override {
}
std::vector<int64_t> self_sizes;
int64_t diagonal = 0;
};
struct TORCH_API DiagonalBackward : public Node {
using Node::Node;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DiagonalBackward"; }
void release_variables() override {
}
std::vector<int64_t> self_sizes;
int64_t offset = 0;
int64_t dim1 = 0;
int64_t dim2 = 0;
};
struct TORCH_API DistBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DistBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
other_.reset_data();
other_.reset_grad_function();
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable self_;
SavedVariable other_;
Scalar p;
SavedVariable result_;
};
struct TORCH_API DivBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DivBackward0"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
other_.reset_data();
other_.reset_grad_function();
}
SavedVariable self_;
SavedVariable other_;
};
struct TORCH_API DivBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DivBackward1"; }
void release_variables() override {
}
Scalar other;
};
struct TORCH_API DotBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "DotBackward"; }
void release_variables() override {
tensor_.reset_data();
tensor_.reset_grad_function();
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable tensor_;
SavedVariable self_;
};
struct TORCH_API FusedDropoutBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "FusedDropoutBackward"; }
void release_variables() override {
result1_.reset_data();
result1_.reset_grad_function();
}
double p;
SavedVariable result1_;
};
struct TORCH_API EigBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "EigBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
eigenvalues_.reset_data();
eigenvalues_.reset_grad_function();
eigenvectors_return_.reset_data();
eigenvectors_return_.reset_grad_function();
}
SavedVariable self_;
bool eigenvectors;
SavedVariable eigenvalues_;
SavedVariable eigenvectors_return_;
};
struct TORCH_API EqBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "EqBackward0"; }
void release_variables() override {
}
TypeAndSize self_info;
};
struct TORCH_API EqBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "EqBackward1"; }
void release_variables() override {
}
TypeAndSize other_info;
TypeAndSize self_info;
};
struct TORCH_API ErfBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ErfBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API ErfcBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ErfcBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API ErfinvBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ErfinvBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
};
struct TORCH_API ExpBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ExpBackward"; }
void release_variables() override {
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable result_;
};
struct TORCH_API Expm1Backward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "Expm1Backward"; }
void release_variables() override {
result_.reset_data();
result_.reset_grad_function();
}
SavedVariable result_;
};
struct TORCH_API ExpandBackward : public Node {
using Node::Node;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ExpandBackward"; }
void release_variables() override {
}
std::vector<int64_t> self_sizes;
};
struct TORCH_API ExponentialBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "ExponentialBackward"; }
void release_variables() override {
}
};
struct TORCH_API FakeQuantizePerTensorAffineBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "FakeQuantizePerTensorAffineBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
}
SavedVariable self_;
double scale;
int64_t zero_point = 0;
int64_t quant_min = 0;
int64_t quant_max = 0;
};
struct TORCH_API FakeQuantizePerChannelAffineBackward : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "FakeQuantizePerChannelAffineBackward"; }
void release_variables() override {
self_.reset_data();
self_.reset_grad_function();
scale_.reset_data();
scale_.reset_grad_function();
zero_point_.reset_data();
zero_point_.reset_grad_function();
}
SavedVariable self_;
SavedVariable scale_;
SavedVariable zero_point_;
int64_t axis = 0;
int64_t quant_min = 0;
int64_t quant_max = 0;
};
struct TORCH_API FillBackward0 : public TraceableFunction {
using TraceableFunction::TraceableFunction;
variable_list apply(variable_list&& grads) override;
std::string name() const override { return "FillBackward0"; }
void release_variables() override {
}
};
struct TORCH_API FillBackward1 : public TraceableFunction {
using TraceableFunction::TraceableFunction;