-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathTHSTensor.h
More file actions
1801 lines (1084 loc) · 84.2 KB
/
THSTensor.h
File metadata and controls
1801 lines (1084 loc) · 84.2 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.
#pragma once
#include "../Stdafx.h"
#include "torch/torch.h"
#include "Utils.h"
EXPORT_API(Tensor) THSTensor_abs(const Tensor tensor);
EXPORT_API(void) THSTensor_abs_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_acos(const Tensor tensor);
EXPORT_API(void) THSTensor_acos_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_adaptive_avg_pool1d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength);
EXPORT_API(Tensor) THSTensor_adaptive_avg_pool2d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength);
EXPORT_API(Tensor) THSTensor_adaptive_avg_pool3d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength);
EXPORT_API(Tensor) THSTensor_adaptive_avg_pool3d_backward_out(const Tensor grad_input, const Tensor grad_output, const Tensor tensor);
EXPORT_API(Tensor) THSTensor_adaptive_max_pool1d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength, Tensor* indices);
EXPORT_API(Tensor) THSTensor_adaptive_max_pool2d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength, Tensor* indices);
EXPORT_API(Tensor) THSTensor_adaptive_max_pool3d(const Tensor tensor, const int64_t* outputSize, const int outputSizeLength, Tensor* indices);
EXPORT_API(Tensor) THSTensor_fractional_max_pool2d(const Tensor tensor, const int64_t* kernelSize, const int kernelSizeLength, const int64_t* outputSize, const int outputSizeLength, const double* outputRatio, const int outputRatioLength, Tensor* indices);
EXPORT_API(Tensor) THSTensor_fractional_max_pool3d(const Tensor tensor, const int64_t* kernelSize, const int kernelSizeLength, const int64_t* outputSize, const int outputSizeLength, const double* outputRatio, const int outputRatioLength, Tensor* indices);
EXPORT_API(Tensor) THSTensor_lp_pool1d(const Tensor tensor, const double norm_type, const int64_t* kernelSize, const int kernelSizeLength, const int64_t* stride, const int strideLength, const bool ceil_mode);
EXPORT_API(Tensor) THSTensor_lp_pool2d(const Tensor tensor, const double norm_type, const int64_t* kernelSize, const int kernelSizeLength, const int64_t* stride, const int strideLength, const bool ceil_mode);
EXPORT_API(Tensor) THSTensor_add(const Tensor left, const Tensor right, const Scalar alpha);
EXPORT_API(void) THSTensor_add_(const Tensor left, const Tensor right, const Scalar alpha);
EXPORT_API(Tensor) THSTensor_add_scalar(const Tensor left, const Scalar right, const Scalar alpha);
EXPORT_API(void) THSTensor_add_scalar_(const Tensor left, const Scalar right, const Scalar alpha);
EXPORT_API(Tensor) THSTensor_addbmm(const Tensor left, const Tensor batch1, const Tensor batch2, const float beta, const float alpha);
EXPORT_API(void) THSTensor_addbmm_(const Tensor left, const Tensor batch1, const Tensor batch2, const float beta, const float alpha);
EXPORT_API(Tensor) THSTensor_addcdiv(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value);
EXPORT_API(void) THSTensor_addcdiv_(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value);
EXPORT_API(Tensor) THSTensor_addcmul(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value);
EXPORT_API(void) THSTensor_addcmul_(const Tensor left, const Tensor tensor1, const Tensor tensor2, const Scalar value);
EXPORT_API(Tensor) THSTensor_addmm(const Tensor left, const Tensor mat1, const Tensor mat2, const float beta, const float alpha);
EXPORT_API(void) THSTensor_addmm_(const Tensor left, const Tensor mat1, const Tensor mat2, const float beta, const float alpha);
EXPORT_API(Tensor) THSTensor_addmv(const Tensor left, const Tensor mat1, const Tensor vec2, const float beta, const float alpha);
EXPORT_API(void) THSTensor_addmv_(const Tensor left, const Tensor mat1, const Tensor vec2, const float beta, const float alpha);
EXPORT_API(Tensor) THSTensor_addr(const Tensor input, const Tensor mat1, const Tensor vec2, const float beta, const float alpha);
EXPORT_API(void) THSTensor_addr_(const Tensor input, const Tensor mat1, const Tensor vec2, const float beta, const float alpha);
EXPORT_API(Tensor) THSTensor_adjoint(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_alias(const Tensor tensor);
EXPORT_API(int) THSTensor_allclose(const Tensor left, const Tensor right, double rtol, double atol, bool equal_nan);
EXPORT_API(Tensor) THSTensor_all(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_all_along_dimension(const Tensor tensor, const int64_t dim, bool keepdim);
EXPORT_API(Tensor) THSTensor_amax(const Tensor tensor, const int64_t* dimensions, int length, bool keepdim);
EXPORT_API(Tensor) THSTensor_amax_out(const Tensor tensor, const int64_t* dimensions, int length, bool keepdim, const Tensor out);
EXPORT_API(Tensor) THSTensor_amin(const Tensor tensor, const int64_t* dimensions, int length, bool keepdim);
EXPORT_API(Tensor) THSTensor_amin_out(const Tensor tensor, const int64_t* dimensions, int length, bool keepdim, const Tensor out);
EXPORT_API(Tensor) THSTensor_aminmax(const Tensor tensor, const int64_t dim, bool keepdim, Tensor* max);
EXPORT_API(Tensor) THSTensor_any(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_any_along_dimension(const Tensor tensor, const int64_t dim, bool keepdim);
EXPORT_API(Tensor) THSTensor_angle(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_arange(const Scalar start, const Scalar end, const Scalar step, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_arange_out(const Scalar start, const Scalar end, const Scalar step, const Tensor out);
EXPORT_API(Tensor) THSTensor_arccosh(const Tensor tensor);
EXPORT_API(void) THSTensor_arccosh_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_arcsinh(const Tensor tensor);
EXPORT_API(void) THSTensor_arcsinh_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_arctanh(const Tensor tensor);
EXPORT_API(void) THSTensor_arctanh_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_argmax(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_argmax_along_dimension(const Tensor tensor, const int64_t dim, bool keepdim);
EXPORT_API(Tensor) THSTensor_argmin(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_argmin_along_dimension(const Tensor tensor, const int64_t dim, bool keepdim);
EXPORT_API(Tensor) THSTensor_argsort(const Tensor tensor, const int64_t dim, bool descending);
EXPORT_API(Tensor) THSTensor_argwhere(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_asin(const Tensor tensor);
EXPORT_API(void) THSTensor_asin_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_atan(const Tensor tensor);
EXPORT_API(void) THSTensor_atan_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_atan2(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_atan2_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_atleast_1d (const Tensor tensor);
EXPORT_API(Tensor) THSTensor_atleast_2d(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_atleast_3d(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_avg_pool1d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
bool ceil_mode,
bool count_include_pad);
EXPORT_API(Tensor) THSTensor_avg_pool2d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
bool ceil_mode,
bool count_include_pad,
const int64_t divisor_override);
EXPORT_API(Tensor) THSTensor_avg_pool2d_backward(
const Tensor grad_output,
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
bool ceil_mode,
bool count_include_pad,
const int64_t divisor_override);
EXPORT_API(Tensor) THSTensor_avg_pool3d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
bool ceil_mode,
bool count_include_pad,
const int64_t divisor_override);
EXPORT_API(Tensor) THSTensor_avg_pool3d_backward(
const Tensor grad_output,
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
bool ceil_mode,
bool count_include_pad,
const int64_t divisor_override);
EXPORT_API(Tensor) THSTensor_baddbmm(const Tensor batch1, const Tensor batch2, const Tensor left, const float beta, const float alpha);
EXPORT_API(void) THSTensor_backward(Tensor tensor);
EXPORT_API(Tensor) THSTensor_bincount(const Tensor tensor, const Tensor weights, const int64_t minlength);
EXPORT_API(Tensor) THSTensor_bitwise_and(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_bitwise_and_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_bitwise_not(const Tensor tensor);
EXPORT_API(void) THSTensor_bitwise_not_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_bitwise_or(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_bitwise_or_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_bitwise_xor(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_bitwise_xor_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_bitwise_left_shift(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_bitwise_left_shift_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_bitwise_right_shift(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_bitwise_right_shift_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_block_diag(const Tensor* tensor, const int length);
EXPORT_API(Tensor) THSTensor_bmm(const Tensor b1wrapper, const Tensor b2wrapper);
EXPORT_API(Tensor) THSTensor_broadcast_to(const Tensor tensor, const int64_t* shape, const int shape_len);
EXPORT_API(void) THSTensor_broadcast_tensors(const Tensor* tensor, const int length, Tensor* (*allocator)(size_t length));
EXPORT_API(Tensor) THSTensor_bucketize(const Tensor tensor, const Tensor boundaries, const bool out_int32, const bool right);
EXPORT_API(Tensor) THSTensor_cartesian_prod(const Tensor* tensor, const int length);
EXPORT_API(Tensor) THSTensor_cat(const Tensor* tensor, const int length, const int64_t dim);
EXPORT_API(Tensor) THSTensor_channel_shuffle(const Tensor tensor, const int64_t groups);
EXPORT_API(Tensor) THSTensor_cdist(const Tensor x1, const Tensor x2, const double p, const int64_t compute_mode);
EXPORT_API(double) THSTensor_clip_grad_norm_(const Tensor* tensor, const int length, const double max_norm, const double norm_type);
EXPORT_API(void) THSTensor_clip_grad_value_(const Tensor* tensors, const int length, const double value);
EXPORT_API(Tensor) THSTensor_parameters_to_vector(const Tensor* tensors, const int length);
EXPORT_API(void) THSTensor_vector_to_parameters(const Tensor vec, const Tensor* tensors, const int length);
EXPORT_API(Tensor) THSTensor_clone(const Tensor input);
EXPORT_API(Tensor) THSTensor_combinations(const Tensor tensor, const int r, const bool with_replacement);
EXPORT_API(Tensor) THSTensor_contiguous(const Tensor input);
EXPORT_API(Tensor) THSTensor_ceil(const Tensor tensor);
EXPORT_API(void) THSTensor_ceil_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_celu(const Tensor tensor, const Scalar alpha);
EXPORT_API(void) THSTensor_celu_(const Tensor tensor, const Scalar alpha);
EXPORT_API(Tensor) THSTensor_hardshrink(const Tensor tensor, const Scalar lambda);
EXPORT_API(Tensor) THSTensor_softshrink(const Tensor tensor, const Scalar lambda);
EXPORT_API(Tensor) THSTensor_cholesky(const Tensor tensor, const bool upper);
EXPORT_API(Tensor) THSTensor_cholesky_inverse(const Tensor tensor, const bool upper);
EXPORT_API(Tensor) THSTensor_cholesky_solve(const Tensor tensor, const Tensor tensor2, const bool upper);
EXPORT_API(void) THSTensor_chunk(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t chunks, const int64_t dim);
EXPORT_API(Tensor) THSTensor_clamp(const Tensor input, const Scalar min, const Scalar max);
EXPORT_API(void) THSTensor_clamp_(const Tensor input, const Scalar min, const Scalar max);
EXPORT_API(Tensor) THSTensor_clamp_tensor(const Tensor input, const Tensor min, const Tensor max);
EXPORT_API(void) THSTensor_clamp_tensor_(const Tensor input, const Tensor min, const Tensor max);
EXPORT_API(Tensor) THSTensor_clamp_max(const Tensor input, const Scalar max);
EXPORT_API(void) THSTensor_clamp_max_(const Tensor input, const Scalar max);
EXPORT_API(Tensor) THSTensor_clamp_min(const Tensor input, const Scalar min);
EXPORT_API(void) THSTensor_clamp_min_(const Tensor input, const Scalar min);
EXPORT_API(Tensor) THSTensor_complex(const Tensor real, const Tensor imag);
EXPORT_API(Tensor) THSTensor_conj(const Tensor tensor);
EXPORT_API(int64_t) THSTensor_is_nonzero(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_conj_physical(const Tensor tensor);
EXPORT_API(void) THSTensor_conj_physical_(const Tensor tensor);
EXPORT_API(int64_t) THSTensor_is_conj(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_resolve_conj(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_conv1d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv2d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv3d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv1d_padding(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int padding,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv2d_padding(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int padding,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv3d_padding(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int padding,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv_transpose1d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* output_padding, const int output_paddingLength,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv_transpose2d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* output_padding, const int output_paddingLength,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_conv_transpose3d(const Tensor input, const Tensor weight, const Tensor bias,
const int64_t* strides, const int strides_length,
const int64_t* paddings, const int paddings_length,
const int64_t* output_padding, const int output_paddingLength,
const int64_t* dilations, const int dilations_length,
int64_t groups);
EXPORT_API(Tensor) THSTensor_copysign(const Tensor input, const Tensor other);
EXPORT_API(void) THSTensor_copy_(const Tensor input, const Tensor other, const bool non_blocking);
EXPORT_API(Tensor) THSTensor_cos(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_corrcoef(const Tensor tensor);
EXPORT_API(void) THSTensor_cos_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_cosh(const Tensor tensor);
EXPORT_API(void) THSTensor_cosh_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_count_nonzero(const Tensor tensor, const int64_t* dim, const int dim_len);
EXPORT_API(Tensor) THSTensor_cov(const Tensor input, int64_t correction, const Tensor fweights, const Tensor aweights);
EXPORT_API(bool) THSTensor_is_cpu(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_cpu(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_cross(const Tensor tensor, const Tensor other, const int64_t dim);
EXPORT_API(Tensor) THSTensor_cuda(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_pin_memory(const Tensor tensor);
EXPORT_API(int64_t) THSTensor_is_pinned(const Tensor tensor);
EXPORT_API(void) THSTensor_cummax(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t dim);
EXPORT_API(void) THSTensor_cummin(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t dim);
EXPORT_API(Tensor) THSTensor_cumprod(const Tensor tensor, const int64_t dim, bool has_type, const int8_t dtype);
EXPORT_API(Tensor) THSTensor_cumsum(const Tensor tensor, const int64_t dim, bool has_type, const int8_t dtype);
EXPORT_API(void*) THSTensor_data(const Tensor tensor);
EXPORT_API(float) THSTensor_data_idx_float16(const Tensor tensor, const int64_t i);
EXPORT_API(float) THSTensor_data_idx_bfloat16(const Tensor tensor, const int64_t i);
EXPORT_API(Tensor) THSTensor_deg2rad(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_detach(const Tensor tensor);
EXPORT_API(void) THSTensor_detach_(const Tensor tensor);
EXPORT_API(const char*) THSTensor_device_str(const Tensor tensor);
EXPORT_API(int) THSTensor_device_type(const Tensor tensor);
EXPORT_API(int) THSTensor_device_index(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_diag(const Tensor tensor, const int64_t diagonal);
EXPORT_API(Tensor) THSTensor_diag_embed(const Tensor tensor, const int64_t offset, const int64_t dim1, const int64_t dim2);
EXPORT_API(Tensor) THSTensor_trace(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_diagflat(const Tensor tensor, const int64_t offset);
EXPORT_API(Tensor) THSTensor_diagonal(const Tensor tensor, const int64_t offset, const int64_t dim1, const int64_t dim2);
EXPORT_API(Tensor) THSTensor_diff(const Tensor tensor, const int64_t n, const int64_t dim, const Tensor prepend, const Tensor append);
EXPORT_API(void) THSTensor_free(const Tensor tensor);
EXPORT_API(void) THSTensor_dispose(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_dist(const Tensor tensor, const Tensor other, const float p);
EXPORT_API(Tensor) THSTensor_div(const Tensor left, const Tensor right, const char* rounding_mode);
EXPORT_API(void) THSTensor_div_(const Tensor left, const Tensor right, const char* rounding_mode);
EXPORT_API(Tensor) THSTensor_div_scalar(const Tensor left, const Scalar right, const char* rounding_mode);
EXPORT_API(void) THSTensor_div_scalar_(const Tensor left, const Scalar right, const char* rounding_mode);
EXPORT_API(Tensor) THSTensor_dot(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_einsum(const char* equation, const Tensor* tensors, const int length);
EXPORT_API(int64_t) THSTensor_element_size(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_elu(const Tensor tensor, const Scalar alpha, const Scalar scale, const Scalar input_scale);
EXPORT_API(void) THSTensor_elu_(const Tensor tensor, const Scalar alpha, const Scalar scale, const Scalar input_scale);
EXPORT_API(Tensor) THSTensor_empty(
const int64_t* sizes,
const int length,
const int8_t scalar_type,
const int device_type, const int device_index,
const bool requires_grad);
EXPORT_API(Tensor) THSTensor_empty_out(const int64_t* sizes, const int length, const Tensor out);
EXPORT_API(Tensor) THSTensor_empty_like(
const Tensor input,
const int8_t scalar_type,
const int device_type, const int device_index,
const bool requires_grad);
EXPORT_API(Tensor) THSTensor_empty_strided(
const int64_t* sizes,
const int sz_length,
const int64_t* strides,
const int str_length,
const int8_t scalar_type,
const int device_type, const int device_index,
const bool requires_grad);
EXPORT_API(Tensor) THSTensor_as_strided(
const Tensor input,
const int64_t* sizes,
const int sz_length,
const int64_t* strides,
const int str_length,
const int64_t storage_offset);
EXPORT_API(Tensor) THSTensor_eq(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_eq_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_eq_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_eq_scalar_(const Tensor left, const Scalar right);
EXPORT_API(int) THSTensor_equal(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_exp(const Tensor tensor);
EXPORT_API(void) THSTensor_exp_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_exp2(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_expm1(const Tensor tensor);
EXPORT_API(void) THSTensor_expm1_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_expand(const Tensor tensor, const int64_t* sizes, const int length, bool implicit);
EXPORT_API(Tensor) THSTensor_erf(const Tensor tensor);
EXPORT_API(void) THSTensor_erf_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_erfc(const Tensor tensor);
EXPORT_API(void) THSTensor_erfc_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_erfinv(const Tensor tensor);
EXPORT_API(void) THSTensor_erfinv_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_eye(const int64_t n, const int64_t m, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_eye_out(const int64_t n, const int64_t m, const Tensor out);
EXPORT_API(void) THSTensor_fill_(const Tensor tensor, Scalar value);
EXPORT_API(Tensor) THSTensor_flatten(const Tensor tensor, const int64_t start, const int64_t end);
EXPORT_API(Tensor) THSTensor_flip(const Tensor tensor, const int64_t* sizes, const int length);
EXPORT_API(Tensor) THSTensor_fliplr(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_flipud(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_float_power(const Tensor input, const Tensor exponent);
EXPORT_API(Tensor) THSTensor_floor(const Tensor tensor);
EXPORT_API(void) THSTensor_floor_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_floor_divide(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_floor_divide_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_floor_divide_(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_floor_divide_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_true_divide(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_true_divide_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_true_divide_(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_true_divide_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_frac(const Tensor tensor);
EXPORT_API(void) THSTensor_frac_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_fmax(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_fmin(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_fmod(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_fmod_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_fmod_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_fmod_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_frexp(const Tensor tensor, Tensor* exponent);
EXPORT_API(Tensor) THSTensor_full(const int64_t* sizes, const int length, Scalar value, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_full_out(const int64_t* sizes, const int length, Scalar value, const Tensor out);
EXPORT_API(Tensor) THSTensor_full_like(const Tensor input, Scalar value, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_digamma(const Tensor tensor);
EXPORT_API(void) THSTensor_digamma_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_lgamma(const Tensor tensor);
EXPORT_API(void) THSTensor_lgamma_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_mvlgamma(const Tensor tensor, int64_t p);
EXPORT_API(void) THSTensor_mvlgamma_(const Tensor tensor, int64_t p);
EXPORT_API(Tensor) THSTensor_gather(const Tensor tensor, const int64_t dim, const Tensor index);
EXPORT_API(Tensor) THSTensor_ge(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_ge_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_ge_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_ge_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_gelu(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_gelu_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_glu(const Tensor tensor, const int64_t dim);
EXPORT_API(Tensor) THSTensor_get1(const Tensor tensor, int64_t index);
EXPORT_API(Tensor) THSTensor_get2(const Tensor tensor, int64_t index1, int64_t index2);
EXPORT_API(Tensor) THSTensor_get3(const Tensor tensor, int64_t index1, int64_t index2, int64_t index3);
EXPORT_API(Tensor) THSTensor_get4(const Tensor tensor, int64_t index1, int64_t index2, int64_t index3, int64_t index4);
EXPORT_API(Tensor) THSTensor_get5(const Tensor tensor, int64_t index1, int64_t index2, int64_t index3, int64_t index4, int64_t index5);
EXPORT_API(Tensor) THSTensor_get6(const Tensor tensor, int64_t index1, int64_t index2, int64_t index3, int64_t index4, int64_t index5, int64_t index6);
EXPORT_API(Tensor) THSTensor_gcd(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_gcd_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_grad(const Tensor tensor);
EXPORT_API(void) THSTensor_set_grad(const Tensor tensor, const Tensor grad);
EXPORT_API(Tensor) THSTensor_gt(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_gt_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_gt_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_gt_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_hardtanh(const Tensor tensor, Scalar min, Scalar max);
EXPORT_API(void) THSTensor_hardtanh_(const Tensor tensor, Scalar min, Scalar max);
EXPORT_API(Tensor) THSTensor_heaviside(const Tensor input, const Tensor values);
EXPORT_API(Tensor) THSTensor_hypot(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_i0(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_igamma(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_igammac(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_hardsigmoid(const Tensor tensor);
EXPORT_API(void) THSTensor_hardsigmoid_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_hardswish(const Tensor tensor);
EXPORT_API(void) THSTensor_hardswish_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_histc(const Tensor tensor, const int64_t bins, const int64_t min, const int64_t max);
EXPORT_API(Tensor) THSTensor_imag(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_index_add(const Tensor tensor, const int64_t dim, const Tensor index, const Tensor source, const Scalar alpha);
EXPORT_API(void) THSTensor_index_add_(const Tensor tensor, const int64_t dim, const Tensor index, const Tensor source, const Scalar alpha);
EXPORT_API(Tensor) THSTensor_index_copy(const Tensor tensor, const int64_t dim, const Tensor index, const Tensor source);
EXPORT_API(void) THSTensor_index_copy_(const Tensor tensor, const int64_t dim, const Tensor index, const Tensor source);
EXPORT_API(Tensor) THSTensor_index_fill(const Tensor tensor, const int64_t dim, const Tensor index, const Scalar value);
EXPORT_API(void) THSTensor_index_fill_(const Tensor tensor, const int64_t dim, const Tensor index, const Scalar value);
EXPORT_API(Tensor) THSTensor_indices(Tensor tensor);
EXPORT_API(Tensor) THSTensor_index(Tensor tensor,
const int64_t* indexStarts,
const int64_t* indexEnds,
const int64_t* indexSteps,
const Tensor* indexTensors,
const int indicesLength);
EXPORT_API(void) THSTensor_index_put_scalar_(Tensor tensor,
const int64_t* indexStarts,
const int64_t* indexEnds,
const int64_t* indexSteps,
const Tensor* indexTensors,
const int indicesLength,
const Scalar value);
EXPORT_API(void) THSTensor_index_put_(Tensor tensor,
const int64_t* indexStarts,
const int64_t* indexEnds,
const int64_t* indexSteps,
const Tensor* indexTensors,
const int indicesLength,
const Tensor value,
const bool accumulate = false);
EXPORT_API(Tensor) THSTensor_index_select(Tensor tensor, int64_t dim, Tensor index);
EXPORT_API(Tensor) THSTensor_inner(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_inverse(const Tensor tensor);
EXPORT_API(int) THSTensor_is_contiguous(const Tensor input);
EXPORT_API(int64_t) THSTensor_is_leaf(const Tensor tensor);
EXPORT_API(int) THSTensor_is_sparse(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isclose(const Tensor tensor, const Tensor other, const double rtol, const double atol, const bool equal_nan);
EXPORT_API(Tensor) THSTensor_isin(const Tensor elements, const Tensor test_elements, bool assume_unique, bool invert);
EXPORT_API(Tensor) THSTensor_isinf(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isfinite(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isposinf(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isneginf(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isnan(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_isreal(const Tensor tensor);
EXPORT_API(Scalar) THSTensor_item(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_kron(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_kthvalue(const Tensor input, int64_t k, int64_t dim, bool keepdim, Tensor* out);
EXPORT_API(Tensor) THSTensor_lcm(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_lcm_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_ldexp(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_ldexp_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_le(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_le_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_le_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_le_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_leaky_relu(const Tensor tensor, const Scalar negval);
EXPORT_API(void) THSTensor_leaky_relu_(const Tensor tensor, const Scalar negval);
EXPORT_API(Tensor) THSTensor_lerp(const Tensor tensor, const Tensor end, const Tensor weight);
EXPORT_API(void) THSTensor_lerp_(const Tensor tensor, const Tensor end, const Tensor weight);
EXPORT_API(Tensor) THSTensor_linspace(const double start, const double end, const int64_t steps, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_logspace(const double start, const double end, const int64_t steps, double base, const int8_t scalar_type, const int device_type, const int device_index, const bool requires_grad);
EXPORT_API(Tensor) THSTensor_load(const char* location);
EXPORT_API(Tensor) THSTensor_log(const Tensor tensor);
EXPORT_API(void) THSTensor_log_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_log10(const Tensor tensor);
EXPORT_API(void) THSTensor_log10_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_log1p(const Tensor tensor);
EXPORT_API(void) THSTensor_log1p_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_log2(const Tensor tensor);
EXPORT_API(void) THSTensor_log2_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_log_sigmoid(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_logaddexp(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_logaddexp2(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_logcumsumexp(const Tensor tensor, const long dimension);
EXPORT_API(Tensor) THSTensor_logsumexp(const Tensor tensor, const long dimension, const bool keepdim);
EXPORT_API(Tensor) THSTensor_log1p(const Tensor tensor);
EXPORT_API(void) THSTensor_log1p_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_logical_and(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_logical_and_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_logical_not(const Tensor tensor);
EXPORT_API(void) THSTensor_logical_not_(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_logical_or(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_logical_or_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_logical_xor(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_logical_xor_(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_logit(const Tensor tensor, const double* eps);
EXPORT_API(Tensor) THSTensor_logit_(const Tensor tensor, const double* eps);
EXPORT_API(Tensor) THSTensor_lt(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_lt_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_lt_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_lt_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_logical_not(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_lu(const Tensor tensor, bool pivot, bool get_infos, Tensor* infos, Tensor* pivots);
EXPORT_API(Tensor) THSTensor_lu_solve(const Tensor tensor, const Tensor LU_data, const Tensor LU_pivots);
EXPORT_API(Tensor) THSTensor_lu_unpack(const Tensor LU_data, const Tensor LU_pivots, bool unpack_data, bool unpack_pivots, Tensor* L, Tensor* U);
EXPORT_API(Tensor) THSTensor_masked_fill(const Tensor tensor, const Tensor mask, const Scalar value);
EXPORT_API(void) THSTensor_masked_fill_(const Tensor tensor, const Tensor mask, const Scalar value);
EXPORT_API(Tensor) THSTensor_masked_scatter(const Tensor tensor, const Tensor mask, const Tensor source);
EXPORT_API(void) THSTensor_masked_scatter_(const Tensor tensor, const Tensor mask, const Tensor source);
EXPORT_API(Tensor) THSTensor_masked_select(const Tensor tensor, const Tensor mask);
EXPORT_API(Tensor) THSTensor_matmul(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_matrix_exp(const Tensor input);
EXPORT_API(Tensor) THSTensor_max(const Tensor tensor);
EXPORT_API(void) THSTensor_max_along_dimension(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t dim, const bool keep_dim);
EXPORT_API(Tensor) THSTensor_max_elementwise(const Tensor tensor, const Tensor other);
EXPORT_API(Tensor) THSTensor_max_pool1d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(Tensor) THSTensor_max_pool2d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(Tensor) THSTensor_max_pool3d(
const Tensor tensor,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(void) THSTensor_max_pool1d_with_indices(
const Tensor tensor,
Tensor* (*allocator)(size_t length),
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(void) THSTensor_max_pool2d_with_indices(
const Tensor tensor,
Tensor* (*allocator)(size_t length),
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(void) THSTensor_max_pool3d_with_indices(
const Tensor tensor,
Tensor* (*allocator)(size_t length),
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* stride, const int strideLength,
const int64_t* padding, const int paddingLength,
const int64_t* dilation, const int dilationLength,
bool ceil_mode);
EXPORT_API(Tensor) THSTensor_max_unpool1d(
const Tensor tensor,
const Tensor indices,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* outputSize, const int outputSizeLength,
const int64_t* padding, const int paddingLength,
const int64_t* stride, const int strideLength);
EXPORT_API(Tensor) THSTensor_max_unpool2d(
const Tensor tensor,
const Tensor indices,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* outputSize, const int outputSizeLength,
const int64_t* padding, const int paddingLength,
const int64_t* stride, const int strideLength);
EXPORT_API(Tensor) THSTensor_max_unpool3d(
const Tensor tensor,
const Tensor indices,
const int64_t* kernelSize, const int kernelSizeLength,
const int64_t* outputSize, const int outputSizeLength,
const int64_t* padding, const int paddingLength,
const int64_t* stride, const int strideLength);
EXPORT_API(Tensor) THSTensor_mean(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_mean_along_dimensions(const Tensor tensor, const int64_t* dimensions, int length, bool keepdim, bool has_type, const int8_t dtype);
EXPORT_API(Tensor) THSTensor_median(const Tensor tensor);
EXPORT_API(void) THSTensor_mode(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t dim, const bool keep_dim);
EXPORT_API(Tensor) THSTensor_min(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_min_elementwise(const Tensor tensor, const Tensor other);
EXPORT_API(void) THSTensor_min_along_dimension(const Tensor tensor, Tensor* (*allocator)(size_t length), const int64_t dim, const bool keep_dim);
EXPORT_API(Tensor) THSTensor_mm(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_mv(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_movedim(const Tensor tensor, const int64_t* src, const int src_len, const int64_t* dst, const int dst_len);
EXPORT_API(Tensor) THSTensor_msort(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_mul(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_mul_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_mul_scalar(const Tensor tensor, const Scalar scalar);
EXPORT_API(void) THSTensor_mul_scalar_(const Tensor tensor, const Scalar scalar);
EXPORT_API(Tensor) THSTensor_nanmean(const Tensor input, const int64_t* dims, const int dims_len, bool keepdim, int8_t scalar_type);
EXPORT_API(Tensor) THSTensor_nanmedian(const Tensor input);
EXPORT_API(Tensor) THSTensor_nanquantile(const Tensor tensor, const Tensor q, const int64_t dim, const bool keep_dim);
EXPORT_API(Tensor) THSTensor_nansum(const Tensor input);
EXPORT_API(Tensor) THSTensor_nan_to_num(const Tensor input, double* nan, double* posinf, double* neginf);
EXPORT_API(Tensor) THSTensor_narrow(const Tensor tensor, int64_t dim, int64_t start, int64_t length);
EXPORT_API(int64_t) THSTensor_ndimension(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_ne(const Tensor left, const Tensor right);
EXPORT_API(void) THSTensor_ne_(const Tensor left, const Tensor right);
EXPORT_API(Tensor) THSTensor_ne_scalar(const Tensor left, const Scalar right);
EXPORT_API(void) THSTensor_ne_scalar_(const Tensor left, const Scalar right);
EXPORT_API(Tensor) THSTensor_neg(const Tensor tensor);
EXPORT_API(void) THSTensor_neg_(const Tensor tensor);
EXPORT_API(int64_t) THSTensor_is_neg(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_resolve_neg(const Tensor tensor);
EXPORT_API(Tensor) THSTensor_new(
void* data,
void (*deleter)(void*),
const int64_t* sizes,
const int szlength,
int8_t scalar_type,
int8_t dtype,
const int device_type,
const int device_index,
const bool requires_grad);
EXPORT_API(Tensor) THSTensor_frombuffer(
void* data,
void (*deleter)(void*),
const int64_t count,
const ptrdiff_t offset,
int8_t scalar_type,
int8_t dtype,
const int device_type,
const int device_index,
const bool requires_grad);
EXPORT_API(Tensor) THSTensor_newInt64(
int64_t* data,
void (*deleter)(void*),
const int64_t* sizes,
const int szlength,
const int device_type,
const int device_index,