-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathTHSTensorMath.cpp
More file actions
1041 lines (833 loc) · 21.7 KB
/
THSTensorMath.cpp
File metadata and controls
1041 lines (833 loc) · 21.7 KB
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
// Copyright (c) .NET Foundation and Contributors. All Rights Reserved. See LICENSE in the project root for license information.
#include "THSTensor.h"
#include <iostream>
#include <fstream>
Tensor THSTensor_abs(const Tensor tensor)
{
CATCH_TENSOR(tensor->abs());
}
void THSTensor_abs_(const Tensor tensor)
{
CATCH(tensor->abs_();)
}
Tensor THSTensor_acos(const Tensor tensor)
{
CATCH_TENSOR(tensor->acos());
}
void THSTensor_acos_(const Tensor tensor)
{
CATCH(tensor->acos_();)
}
Tensor THSTensor_add(const Tensor left, const Tensor right, const Scalar alpha)
{
CATCH_TENSOR(left->add(*right, *alpha));
}
void THSTensor_add_(const Tensor left, const Tensor right, const Scalar alpha)
{
CATCH(left->add_(*right, *alpha);)
}
Tensor THSTensor_add_scalar(const Tensor left, const Scalar right, const Scalar alpha)
{
CATCH_TENSOR(left->add(*right, *alpha));
}
void THSTensor_add_scalar_(const Tensor left, const Scalar right, const Scalar alpha)
{
CATCH(left->add_(*right, *alpha);)
}
Tensor THSTensor_addbmm(const Tensor mat, const Tensor batch1, const Tensor batch2, const float beta, const float alpha)
{
CATCH_TENSOR(mat->addbmm(*batch1, *batch2, beta, alpha));
}
void THSTensor_addbmm_(const Tensor mat, const Tensor batch1, const Tensor batch2, const float beta, const float alpha)
{
CATCH(mat->addbmm_(*batch1, *batch2, beta, alpha);)
}
Tensor THSTensor_addcdiv(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value)
{
CATCH_TENSOR(left->addcdiv(*tensor1, *tensor2, *value));
}
void THSTensor_addcdiv_(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value)
{
CATCH(left->addcdiv_(*tensor1, *tensor2, *value);)
}
Tensor THSTensor_addcmul(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value)
{
CATCH_TENSOR(left->addcmul(*tensor1, *tensor2, *value));
}
void THSTensor_addcmul_(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value)
{
CATCH(left->addcmul_(*tensor1, *tensor2, *value);)
}
Tensor THSTensor_addmm(const Tensor mat, const Tensor mat1, const Tensor mat2, const float beta, const float alpha)
{
CATCH_TENSOR(mat->addmm(*mat1, *mat2, beta, alpha));
}
void THSTensor_addmm_(const Tensor mat, const Tensor mat1, const Tensor mat2, const float beta, const float alpha)
{
CATCH(mat->addmm_(*mat1, *mat2, beta, alpha);)
}
Tensor THSTensor_addmv(const Tensor mat, const Tensor mat1, const Tensor vec2, const float beta, const float alpha)
{
CATCH_TENSOR(mat->addmv(*mat1, *vec2, beta, alpha));
}
void THSTensor_addmv_(const Tensor mat, const Tensor mat1, const Tensor vec2, const float beta, const float alpha)
{
CATCH(mat->addmv_(*mat1, *vec2, beta, alpha);)
}
Tensor THSTensor_addr(const Tensor mat, const Tensor mat1, const Tensor vec2, const float beta, const float alpha)
{
CATCH_TENSOR(mat->addr(*mat1, *vec2, beta, alpha));
}
void THSTensor_addr_(const Tensor mat, const Tensor mat1, const Tensor vec2, const float beta, const float alpha)
{
CATCH(mat->addr_(*mat1, *vec2, beta, alpha);)
}
Tensor THSTensor_arccosh(const Tensor tensor)
{
CATCH_TENSOR(tensor->arccosh());
}
void THSTensor_arccosh_(const Tensor tensor)
{
CATCH(tensor->arccosh_();)
}
Tensor THSTensor_arcsinh(const Tensor tensor)
{
CATCH_TENSOR(tensor->arcsinh());
}
void THSTensor_arcsinh_(const Tensor tensor)
{
CATCH(tensor->arcsinh_();)
}
Tensor THSTensor_arctanh(const Tensor tensor)
{
CATCH_TENSOR(tensor->arctanh());
}
void THSTensor_arctanh_(const Tensor tensor)
{
CATCH(tensor->arctanh_();)
}
Tensor THSTensor_asin(const Tensor tensor)
{
CATCH_TENSOR(tensor->asin());
}
void THSTensor_asin_(const Tensor tensor)
{
CATCH(tensor->asin_();)
}
Tensor THSTensor_atan(const Tensor tensor)
{
CATCH_TENSOR(tensor->atan());
}
void THSTensor_atan_(const Tensor tensor)
{
CATCH(tensor->atan_();)
}
Tensor THSTensor_atan2(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->atan2(*other));
}
void THSTensor_atan2_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->atan2_(*other);)
}
Tensor THSTensor_baddbmm(
const Tensor batch1,
const Tensor batch2,
const Tensor mat,
const float beta,
const float alpha)
{
CATCH_TENSOR(mat->baddbmm(*batch1, *batch2, beta, alpha));
}
Tensor THSTensor_bitwise_and(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->bitwise_and(*other));
}
void THSTensor_bitwise_and_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->bitwise_and_(*other);)
}
Tensor THSTensor_bitwise_not(const Tensor tensor)
{
CATCH_TENSOR(tensor->bitwise_not());
}
void THSTensor_bitwise_not_(const Tensor tensor)
{
CATCH(tensor->bitwise_not_();)
}
Tensor THSTensor_bitwise_or(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->bitwise_or(*other));
}
void THSTensor_bitwise_or_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->bitwise_or_(*other);)
}
Tensor THSTensor_bitwise_xor(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->bitwise_xor(*other));
}
void THSTensor_bitwise_xor_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->bitwise_xor_(*other);)
}
Tensor THSTensor_bitwise_left_shift(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->bitwise_left_shift(*other));
}
void THSTensor_bitwise_left_shift_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->bitwise_left_shift_(*other);)
}
Tensor THSTensor_bitwise_right_shift(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->bitwise_right_shift(*other));
}
void THSTensor_bitwise_right_shift_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->bitwise_right_shift_(*other);)
}
Tensor THSTensor_bmm(const Tensor batch1, const Tensor batch2)
{
CATCH_TENSOR(batch1->bmm(*batch2));
}
Tensor THSTensor_cdist(const Tensor x1, const Tensor x2, const double p, const int64_t compute_mode)
{
CATCH_TENSOR(compute_mode == 0
? torch::cdist(*x1, *x2, p)
: torch::cdist(*x1, *x2, p, compute_mode));
}
Tensor THSTensor_ceil(const Tensor tensor)
{
CATCH_TENSOR(tensor->ceil());
}
void THSTensor_ceil_(const Tensor tensor)
{
CATCH(tensor->ceil_();)
}
Tensor THSTensor_conj(const Tensor tensor)
{
CATCH_TENSOR(tensor->conj());
}
int64_t THSTensor_is_conj(const Tensor tensor)
{
CATCH_RETURN_RES(int64_t, -1, res = tensor->is_conj();)
}
int64_t THSTensor_is_neg(const Tensor tensor)
{
CATCH_RETURN_RES(int64_t, -1, res = tensor->is_neg();)
}
Tensor THSTensor_conj_physical(const Tensor tensor)
{
CATCH_TENSOR(tensor->conj_physical());
}
void THSTensor_conj_physical_(const Tensor tensor)
{
CATCH(tensor->conj_physical_();)
}
Tensor THSTensor_resolve_conj(const Tensor tensor)
{
CATCH_TENSOR(tensor->resolve_conj());
}
Tensor THSTensor_resolve_neg(const Tensor tensor)
{
CATCH_TENSOR(tensor->resolve_neg());
}
Tensor THSTensor_cos(const Tensor tensor)
{
CATCH_TENSOR(tensor->cos());
}
void THSTensor_cos_(const Tensor tensor)
{
CATCH(tensor->cos_();)
}
Tensor THSTensor_cosh(const Tensor tensor)
{
CATCH_TENSOR(tensor->cosh());
}
void THSTensor_cosh_(const Tensor tensor)
{
CATCH(tensor->cosh_();)
}
Tensor THSTensor_cov(const Tensor input, int64_t correction, const Tensor fweights, const Tensor aweights)
{
c10::optional<at::Tensor> fw = (fweights == nullptr) ? c10::optional<at::Tensor>() : *fweights;
c10::optional<at::Tensor> aw = (aweights == nullptr) ? c10::optional<at::Tensor>() : *aweights;
CATCH_TENSOR(input->cov(correction, fw, aw));
}
Tensor THSTensor_cross(const Tensor tensor, const Tensor other, const int64_t dim)
{
CATCH_TENSOR(tensor->cross(*other, dim));
}
Tensor THSTensor_deg2rad(const Tensor tensor)
{
CATCH_TENSOR(torch::deg2rad(*tensor));
}
Tensor THSTensor_div(const Tensor left, const Tensor right, const char* rounding_mode)
{
CATCH_TENSOR(rounding_mode == nullptr ? left->div(*right) : left->div(*right, rounding_mode));
}
void THSTensor_div_(const Tensor left, const Tensor right, const char* rounding_mode)
{
CATCH(rounding_mode == nullptr ? left->div_(*right) : left->div_(*right, rounding_mode);)
}
Tensor THSTensor_div_scalar(const Tensor left, const Scalar right, const char* rounding_mode)
{
CATCH_TENSOR(rounding_mode == nullptr ? left->div(*right) : left->div(*right, rounding_mode));
}
void THSTensor_div_scalar_(const Tensor left, const Scalar right, const char* rounding_mode)
{
CATCH(rounding_mode == nullptr ? left->div_(*right) : left->div_(*right, rounding_mode);)
}
Tensor THSTensor_dot(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->dot(*right));
}
Tensor THSTensor_einsum(const char* equation, const Tensor* tensors, const int length)
{
CATCH_TENSOR(torch::einsum(equation, toTensors<at::Tensor>((torch::Tensor**)tensors, length)));
}
Tensor THSTensor_eq(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->eq(*right));
}
void THSTensor_eq_(const Tensor left, const Tensor right)
{
CATCH(left->eq_(*right);)
}
Tensor THSTensor_eq_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->eq(*right));
}
void THSTensor_eq_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->eq_(*right);)
}
int THSTensor_equal(const Tensor left, const Tensor right)
{
CATCH_RETURN(int, 0, left->equal(*right));
}
Tensor THSTensor_exp(const Tensor tensor)
{
CATCH_TENSOR(tensor->exp());
}
Tensor THSTensor_exp2(const Tensor tensor)
{
CATCH_TENSOR(tensor->exp2());
}
void THSTensor_exp_(const Tensor tensor)
{
CATCH(tensor->exp_();)
}
Tensor THSTensor_expm1(const Tensor tensor)
{
CATCH_TENSOR(tensor->expm1());
}
void THSTensor_expm1_(const Tensor tensor)
{
CATCH(tensor->expm1_();)
}
Tensor THSTensor_erf(const Tensor tensor)
{
CATCH_TENSOR(tensor->erf());
}
void THSTensor_erf_(const Tensor tensor)
{
CATCH(tensor->erf_();)
}
Tensor THSTensor_erfc(const Tensor tensor)
{
CATCH_TENSOR(tensor->erfc());
}
void THSTensor_erfc_(const Tensor tensor)
{
CATCH(tensor->erfc_();)
}
Tensor THSTensor_erfinv(const Tensor tensor)
{
CATCH_TENSOR(tensor->erfinv());
}
void THSTensor_erfinv_(const Tensor tensor)
{
CATCH(tensor->erfinv_();)
}
Tensor THSTensor_float_power(const Tensor input, const Tensor exponent)
{
CATCH_TENSOR(input->float_power(*exponent));
}
Tensor THSTensor_floor(const Tensor tensor)
{
CATCH_TENSOR(tensor->floor());
}
void THSTensor_floor_(const Tensor tensor)
{
CATCH(tensor->floor_();)
}
Tensor THSTensor_floor_divide(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->floor_divide(*right));
}
Tensor THSTensor_floor_divide_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->floor_divide(*right));
}
void THSTensor_floor_divide_(const Tensor left, const Tensor right)
{
CATCH(left->floor_divide_(*right);)
}
void THSTensor_floor_divide_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->floor_divide_(*right);)
}
Tensor THSTensor_true_divide(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->true_divide(*right));
}
Tensor THSTensor_true_divide_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->true_divide(*right));
}
void THSTensor_true_divide_(const Tensor left, const Tensor right)
{
CATCH(left->true_divide_(*right);)
}
void THSTensor_true_divide_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->true_divide_(*right);)
}
Tensor THSTensor_fmax(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->fmax(*right));
}
Tensor THSTensor_fmin(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->fmin(*right));
}
Tensor THSTensor_fmod(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->fmod(*right));
}
void THSTensor_fmod_(const Tensor left, const Tensor right)
{
CATCH(left->fmod_(*right);)
}
Tensor THSTensor_fmod_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->fmod(*right));
}
void THSTensor_fmod_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->fmod_(*right);)
}
Tensor THSTensor_frac(const Tensor tensor)
{
CATCH_TENSOR(tensor->frac());
}
void THSTensor_frac_(const Tensor tensor)
{
CATCH(tensor->frac_();)
}
Tensor THSTensor_ge(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->ge(*right));
}
void THSTensor_ge_(const Tensor left, const Tensor right)
{
CATCH(left->ge_(*right);)
}
Tensor THSTensor_ge_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->ge(*right));
}
void THSTensor_ge_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->ge_(*right);)
}
Tensor THSTensor_gt(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->gt(*right));
}
void THSTensor_gt_(const Tensor left, const Tensor right)
{
CATCH(left->gt_(*right);)
}
Tensor THSTensor_gt_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->gt(*right));
}
void THSTensor_gt_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->gt_(*right);)
}
Tensor THSTensor_histc(const Tensor tensor, const int64_t bins, const int64_t min, const int64_t max)
{
CATCH_TENSOR(tensor->histc(bins, min, max));
}
Tensor THSTensor_ldexp(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->ldexp(*right));
}
void THSTensor_ldexp_(const Tensor left, const Tensor right)
{
CATCH(left->ldexp_(*right);)
}
Tensor THSTensor_le(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->le(*right));
}
void THSTensor_le_(const Tensor left, const Tensor right)
{
CATCH(left->le_(*right);)
}
Tensor THSTensor_le_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->le(*right));
}
void THSTensor_le_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->le_(*right);)
}
Tensor THSTensor_logcumsumexp(const Tensor tensor, const long dimension)
{
CATCH_TENSOR(torch::logcumsumexp(*tensor, dimension));
}
Tensor THSTensor_logaddexp(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(torch::logaddexp(*tensor, *other));
}
Tensor THSTensor_logaddexp2(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(torch::logaddexp2(*tensor, *other));
}
Tensor THSTensor_logsumexp(const Tensor tensor, const long dim, const bool keepdim)
{
CATCH_TENSOR(torch::logsumexp(*tensor, dim, keepdim));
}
Tensor THSTensor_log(const Tensor tensor)
{
CATCH_TENSOR(tensor->log());
}
void THSTensor_log_(const Tensor tensor)
{
CATCH(tensor->log_();)
}
Tensor THSTensor_log2(const Tensor tensor)
{
CATCH_TENSOR(tensor->log2());
}
void THSTensor_log2_(const Tensor tensor)
{
CATCH(tensor->log2_();)
}
Tensor THSTensor_log10(const Tensor tensor)
{
CATCH_TENSOR(tensor->log10());
}
void THSTensor_log10_(const Tensor tensor)
{
CATCH(tensor->log10_();)
}
Tensor THSTensor_log1p(const Tensor tensor)
{
CATCH_TENSOR(tensor->log1p());
}
void THSTensor_log1p_(const Tensor tensor)
{
CATCH(tensor->log1p_();)
}
Tensor THSTensor_logical_and(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->logical_and(*other));
}
void THSTensor_logical_and_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->logical_and_(*other);)
}
Tensor THSTensor_logical_not(const Tensor tensor)
{
CATCH_TENSOR(tensor->logical_not());
}
void THSTensor_logical_not_(const Tensor tensor)
{
CATCH(tensor->logical_not_();)
}
Tensor THSTensor_logical_or(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->logical_or(*other));
}
void THSTensor_logical_or_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->logical_or_(*other);)
}
Tensor THSTensor_logical_xor(const Tensor tensor, const Tensor other)
{
CATCH_TENSOR(tensor->logical_xor(*other));
}
void THSTensor_logical_xor_(const Tensor tensor, const Tensor other)
{
CATCH(tensor->logical_xor_(*other);)
}
Tensor THSTensor_logit(const Tensor tensor, const double* eps)
{
CATCH_TENSOR((eps == nullptr) ? tensor->logit() : tensor->logit(*eps));
}
Tensor THSTensor_logit_(const Tensor tensor, const double* eps)
{
CATCH_TENSOR((eps == nullptr) ? tensor->logit_() : tensor->logit_(*eps));
}
Tensor THSTensor_lt(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->lt(*right));
}
void THSTensor_lt_(const Tensor left, const Tensor right)
{
CATCH(left->lt_(*right);)
}
Tensor THSTensor_lt_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->lt(*right));
}
void THSTensor_lt_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->lt_(*right);)
}
Tensor THSTensor_matmul(const Tensor left, const Tensor right)
{
return new torch::Tensor(left->matmul(*right));
}
Tensor THSTensor_matrix_exp(const Tensor input)
{
CATCH_TENSOR(input->matrix_exp());
}
Tensor THSTensor_mm(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->mm(*right));
}
Tensor THSTensor_mv(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->mv(*right));
}
Tensor THSTensor_vdot(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->vdot(*right));
}
Tensor THSTensor_mul(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->mul(*right));
}
void THSTensor_mul_(const Tensor left, const Tensor right)
{
CATCH(left->mul_(*right);)
}
Tensor THSTensor_mul_scalar(const Tensor tensor, const Scalar scalar)
{
CATCH_TENSOR(tensor->mul(*scalar));
}
void THSTensor_mul_scalar_(const Tensor tensor, const Scalar scalar)
{
CATCH(tensor->mul_(*scalar);)
}
Tensor THSTensor_mvlgamma(const Tensor tensor, int64_t p)
{
CATCH_TENSOR(tensor->mvlgamma(p));
}
void THSTensor_mvlgamma_(const Tensor tensor, int64_t p)
{
CATCH(tensor->mvlgamma_(p);)
}
Tensor THSTensor_ne(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->ne(*right));
}
void THSTensor_ne_(const Tensor left, const Tensor right)
{
CATCH(left->ne_(*right);)
}
Tensor THSTensor_ne_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->ne(*right));
}
void THSTensor_ne_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->ne_(*right);)
}
Tensor THSTensor_neg(const Tensor tensor)
{
CATCH_TENSOR(tensor->neg());
}
void THSTensor_neg_(const Tensor tensor)
{
CATCH(tensor->neg_();)
}
Tensor THSTensor_pow(const Tensor tensor, const Tensor exponent)
{
CATCH_TENSOR(tensor->pow(*exponent));
}
void THSTensor_pow_(const Tensor tensor, const Tensor exponent)
{
CATCH(tensor->pow_(*exponent);)
}
Tensor THSTensor_pow_scalar(const Tensor tensor, const Scalar exponent)
{
CATCH_TENSOR(tensor->pow(*exponent));
}
void THSTensor_pow_scalar_(const Tensor tensor, const Scalar exponent)
{
CATCH(tensor->pow_(*exponent);)
}
Tensor THSTensor_rad2deg(const Tensor tensor)
{
CATCH_TENSOR(torch::rad2deg(*tensor));
}
Tensor THSTensor_reciprocal(const Tensor tensor)
{
CATCH_TENSOR(torch::reciprocal(*tensor));
}
void THSTensor_reciprocal_(const Tensor tensor)
{
CATCH(torch::reciprocal_(*tensor);)
}
Tensor THSTensor_remainder(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->remainder(*right));
}
void THSTensor_remainder_(const Tensor left, const Tensor right)
{
CATCH(left->remainder_(*right);)
}
Tensor THSTensor_remainder_scalar(const Tensor left, const Scalar right)
{
CATCH_TENSOR(left->remainder(*right));
}
void THSTensor_remainder_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->remainder_(*right);)
}
Tensor THSTensor_round(const Tensor tensor, const int64_t decimals)
{
CATCH_TENSOR(tensor->round(decimals));
}
void THSTensor_round_(const Tensor tensor, const int64_t decimals)
{
CATCH(tensor->round_(decimals);)
}
Tensor THSTensor_rsqrt(const Tensor tensor)
{
CATCH_TENSOR(tensor->rsqrt());
}
void THSTensor_rsqrt_(const Tensor tensor)
{
CATCH(tensor->rsqrt_();)
}
Tensor THSTensor_sqrt(const Tensor tensor)
{
CATCH_TENSOR(tensor->sqrt());
}
void THSTensor_sqrt_(const Tensor tensor)
{
CATCH(tensor->sqrt_();)
}
Tensor THSTensor_square(const Tensor tensor)
{
CATCH_TENSOR(tensor->square());
}
void THSTensor_square_(const Tensor tensor)
{
CATCH(tensor->square_();)
}
Tensor THSTensor_sign(const Tensor tensor)
{
CATCH_TENSOR(tensor->sign());
}
void THSTensor_sign_(const Tensor tensor)
{
CATCH(tensor->sign_();)
}
Tensor THSTensor_sgn(const Tensor tensor)
{
CATCH_TENSOR(tensor->sgn());
}
void THSTensor_sgn_(const Tensor tensor)
{
CATCH(tensor->sgn_();)
}
Tensor THSTensor_signbit(const Tensor tensor)
{
CATCH_TENSOR(tensor->signbit());
}
Tensor THSTensor_sin(const Tensor tensor)
{
CATCH_TENSOR(tensor->sin());
}
void THSTensor_sin_(const Tensor tensor)
{
CATCH(tensor->sin_();)
}
Tensor THSTensor_sinc(const Tensor tensor)
{
CATCH_TENSOR(tensor->sinc());
}
void THSTensor_sinc_(const Tensor tensor)
{
CATCH(tensor->sinc_();)
}
Tensor THSTensor_sinh(const Tensor tensor)
{
CATCH_TENSOR(tensor->sinh());
}
void THSTensor_sinh_(const Tensor tensor)
{
CATCH(tensor->sinh_();)
}
Tensor THSTensor_sub(const Tensor left, const Tensor right)
{
CATCH_TENSOR(left->sub(*right));
}
void THSTensor_sub_(const Tensor left, const Tensor right)
{
CATCH(left->sub_(*right);)
}
void THSTensor_sub_scalar_(const Tensor left, const Scalar right)
{
CATCH(left->sub_(*right);)
}
Tensor THSTensor_tan(const Tensor tensor)
{
CATCH_TENSOR(tensor->tan());
}
void THSTensor_tan_(const Tensor tensor)
{
CATCH(tensor->tan_();)