torch-rb 0.2.0 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +0,0 @@
1
- // generated by rake generate:functions
2
- // do not edit by hand
3
-
4
- #pragma once
5
-
6
- void add_nn_functions(Module m);
@@ -1,2085 +0,0 @@
1
- // generated by rake generate:functions
2
- // do not edit by hand
3
-
4
- #include <torch/torch.h>
5
- #include <rice/Module.hpp>
6
- #include "templates.hpp"
7
-
8
- void add_tensor_functions(Module m) {
9
- m
10
- .define_method(
11
- "_abs",
12
- *[](const Tensor &self) {
13
- return self.abs();
14
- })
15
- .define_method(
16
- "_abs_",
17
- *[](Tensor &self) {
18
- return self.abs_();
19
- })
20
- .define_method(
21
- "_acos",
22
- *[](const Tensor &self) {
23
- return self.acos();
24
- })
25
- .define_method(
26
- "_acos_",
27
- *[](Tensor &self) {
28
- return self.acos_();
29
- })
30
- .define_method(
31
- "_add__scalar",
32
- *[](Tensor &self, Scalar other, Scalar alpha) {
33
- return self.add_(other, alpha);
34
- })
35
- .define_method(
36
- "_add__tensor",
37
- *[](Tensor &self, const Tensor &other, Scalar alpha) {
38
- return self.add_(other, alpha);
39
- })
40
- .define_method(
41
- "_add_scalar",
42
- *[](const Tensor &self, Scalar other, Scalar alpha) {
43
- return self.add(other, alpha);
44
- })
45
- .define_method(
46
- "_add_tensor",
47
- *[](const Tensor &self, const Tensor &other, Scalar alpha) {
48
- return self.add(other, alpha);
49
- })
50
- .define_method(
51
- "_addbmm",
52
- *[](const Tensor &self, const Tensor &batch1, const Tensor &batch2, Scalar beta, Scalar alpha) {
53
- return self.addbmm(batch1, batch2, beta, alpha);
54
- })
55
- .define_method(
56
- "_addbmm_",
57
- *[](Tensor &self, const Tensor &batch1, const Tensor &batch2, Scalar beta, Scalar alpha) {
58
- return self.addbmm_(batch1, batch2, beta, alpha);
59
- })
60
- .define_method(
61
- "_addcdiv",
62
- *[](const Tensor &self, const Tensor &tensor1, const Tensor &tensor2, Scalar value) {
63
- return self.addcdiv(tensor1, tensor2, value);
64
- })
65
- .define_method(
66
- "_addcdiv_",
67
- *[](Tensor &self, const Tensor &tensor1, const Tensor &tensor2, Scalar value) {
68
- return self.addcdiv_(tensor1, tensor2, value);
69
- })
70
- .define_method(
71
- "_addcmul",
72
- *[](const Tensor &self, const Tensor &tensor1, const Tensor &tensor2, Scalar value) {
73
- return self.addcmul(tensor1, tensor2, value);
74
- })
75
- .define_method(
76
- "_addcmul_",
77
- *[](Tensor &self, const Tensor &tensor1, const Tensor &tensor2, Scalar value) {
78
- return self.addcmul_(tensor1, tensor2, value);
79
- })
80
- .define_method(
81
- "_addmm",
82
- *[](const Tensor &self, const Tensor &mat1, const Tensor &mat2, Scalar beta, Scalar alpha) {
83
- return self.addmm(mat1, mat2, beta, alpha);
84
- })
85
- .define_method(
86
- "_addmm_",
87
- *[](Tensor &self, const Tensor &mat1, const Tensor &mat2, Scalar beta, Scalar alpha) {
88
- return self.addmm_(mat1, mat2, beta, alpha);
89
- })
90
- .define_method(
91
- "_addmv",
92
- *[](const Tensor &self, const Tensor &mat, const Tensor &vec, Scalar beta, Scalar alpha) {
93
- return self.addmv(mat, vec, beta, alpha);
94
- })
95
- .define_method(
96
- "_addmv_",
97
- *[](Tensor &self, const Tensor &mat, const Tensor &vec, Scalar beta, Scalar alpha) {
98
- return self.addmv_(mat, vec, beta, alpha);
99
- })
100
- .define_method(
101
- "_addr",
102
- *[](const Tensor &self, const Tensor &vec1, const Tensor &vec2, Scalar beta, Scalar alpha) {
103
- return self.addr(vec1, vec2, beta, alpha);
104
- })
105
- .define_method(
106
- "_addr_",
107
- *[](Tensor &self, const Tensor &vec1, const Tensor &vec2, Scalar beta, Scalar alpha) {
108
- return self.addr_(vec1, vec2, beta, alpha);
109
- })
110
- .define_method(
111
- "_alias",
112
- *[](Tensor &self) {
113
- return self.alias();
114
- })
115
- .define_method(
116
- "_align_as",
117
- *[](const Tensor &self, const Tensor &other) {
118
- return self.align_as(other);
119
- })
120
- .define_method(
121
- "_all",
122
- *[](const Tensor &self) {
123
- return self.all();
124
- })
125
- .define_method(
126
- "_all_dim",
127
- *[](const Tensor &self, int64_t dim, bool keepdim) {
128
- return self.all(dim, keepdim);
129
- })
130
- .define_method(
131
- "_allclose",
132
- *[](const Tensor &self, const Tensor &other, double rtol, double atol, bool equal_nan) {
133
- return self.allclose(other, rtol, atol, equal_nan);
134
- })
135
- .define_method(
136
- "_angle",
137
- *[](const Tensor &self) {
138
- return self.angle();
139
- })
140
- .define_method(
141
- "_any",
142
- *[](const Tensor &self) {
143
- return self.any();
144
- })
145
- .define_method(
146
- "_any_dim",
147
- *[](const Tensor &self, int64_t dim, bool keepdim) {
148
- return self.any(dim, keepdim);
149
- })
150
- .define_method(
151
- "_argmax",
152
- *[](const Tensor &self) {
153
- return self.argmax();
154
- })
155
- .define_method(
156
- "_argmax_dim",
157
- *[](const Tensor &self, int64_t dim, bool keepdim) {
158
- return self.argmax(dim, keepdim);
159
- })
160
- .define_method(
161
- "_argmin",
162
- *[](const Tensor &self) {
163
- return self.argmin();
164
- })
165
- .define_method(
166
- "_argmin_dim",
167
- *[](const Tensor &self, int64_t dim, bool keepdim) {
168
- return self.argmin(dim, keepdim);
169
- })
170
- .define_method(
171
- "_argsort",
172
- *[](const Tensor &self, int64_t dim, bool descending) {
173
- return self.argsort(dim, descending);
174
- })
175
- .define_method(
176
- "_as_strided",
177
- *[](Tensor &self, IntArrayRef size, IntArrayRef stride) {
178
- return self.as_strided(size, stride);
179
- })
180
- .define_method(
181
- "_as_strided_",
182
- *[](Tensor &self, IntArrayRef size, IntArrayRef stride) {
183
- return self.as_strided_(size, stride);
184
- })
185
- .define_method(
186
- "_as_strided__storage_offset",
187
- *[](Tensor &self, IntArrayRef size, IntArrayRef stride, int64_t storage_offset) {
188
- return self.as_strided_(size, stride, storage_offset);
189
- })
190
- .define_method(
191
- "_as_strided_storage_offset",
192
- *[](Tensor &self, IntArrayRef size, IntArrayRef stride, int64_t storage_offset) {
193
- return self.as_strided(size, stride, storage_offset);
194
- })
195
- .define_method(
196
- "_asin",
197
- *[](const Tensor &self) {
198
- return self.asin();
199
- })
200
- .define_method(
201
- "_asin_",
202
- *[](Tensor &self) {
203
- return self.asin_();
204
- })
205
- .define_method(
206
- "_atan",
207
- *[](const Tensor &self) {
208
- return self.atan();
209
- })
210
- .define_method(
211
- "_atan2",
212
- *[](const Tensor &self, const Tensor &other) {
213
- return self.atan2(other);
214
- })
215
- .define_method(
216
- "_atan2_",
217
- *[](Tensor &self, const Tensor &other) {
218
- return self.atan2_(other);
219
- })
220
- .define_method(
221
- "_atan_",
222
- *[](Tensor &self) {
223
- return self.atan_();
224
- })
225
- .define_method(
226
- "_backward",
227
- *[](const Tensor &self, OptionalTensor gradient, bool keep_graph, bool create_graph) {
228
- return self.backward(gradient, keep_graph, create_graph);
229
- })
230
- .define_method(
231
- "_baddbmm",
232
- *[](const Tensor &self, const Tensor &batch1, const Tensor &batch2, Scalar beta, Scalar alpha) {
233
- return self.baddbmm(batch1, batch2, beta, alpha);
234
- })
235
- .define_method(
236
- "_baddbmm_",
237
- *[](Tensor &self, const Tensor &batch1, const Tensor &batch2, Scalar beta, Scalar alpha) {
238
- return self.baddbmm_(batch1, batch2, beta, alpha);
239
- })
240
- .define_method(
241
- "_bernoulli",
242
- *[](const Tensor &self) {
243
- return self.bernoulli();
244
- })
245
- .define_method(
246
- "_bernoulli__float",
247
- *[](Tensor &self, double p) {
248
- return self.bernoulli_(p);
249
- })
250
- .define_method(
251
- "_bernoulli__tensor",
252
- *[](Tensor &self, const Tensor &p) {
253
- return self.bernoulli_(p);
254
- })
255
- .define_method(
256
- "_bernoulli_p",
257
- *[](const Tensor &self, double p) {
258
- return self.bernoulli(p);
259
- })
260
- .define_method(
261
- "_bincount",
262
- *[](const Tensor &self, OptionalTensor weights, int64_t minlength) {
263
- return self.bincount(weights, minlength);
264
- })
265
- .define_method(
266
- "_bitwise_and__scalar",
267
- *[](Tensor &self, Scalar other) {
268
- return self.bitwise_and_(other);
269
- })
270
- .define_method(
271
- "_bitwise_and__tensor",
272
- *[](Tensor &self, const Tensor &other) {
273
- return self.bitwise_and_(other);
274
- })
275
- .define_method(
276
- "_bitwise_and_scalar",
277
- *[](const Tensor &self, Scalar other) {
278
- return self.bitwise_and(other);
279
- })
280
- .define_method(
281
- "_bitwise_and_tensor",
282
- *[](const Tensor &self, const Tensor &other) {
283
- return self.bitwise_and(other);
284
- })
285
- .define_method(
286
- "_bitwise_not",
287
- *[](const Tensor &self) {
288
- return self.bitwise_not();
289
- })
290
- .define_method(
291
- "_bitwise_not_",
292
- *[](Tensor &self) {
293
- return self.bitwise_not_();
294
- })
295
- .define_method(
296
- "_bitwise_or__scalar",
297
- *[](Tensor &self, Scalar other) {
298
- return self.bitwise_or_(other);
299
- })
300
- .define_method(
301
- "_bitwise_or__tensor",
302
- *[](Tensor &self, const Tensor &other) {
303
- return self.bitwise_or_(other);
304
- })
305
- .define_method(
306
- "_bitwise_or_scalar",
307
- *[](const Tensor &self, Scalar other) {
308
- return self.bitwise_or(other);
309
- })
310
- .define_method(
311
- "_bitwise_or_tensor",
312
- *[](const Tensor &self, const Tensor &other) {
313
- return self.bitwise_or(other);
314
- })
315
- .define_method(
316
- "_bitwise_xor__scalar",
317
- *[](Tensor &self, Scalar other) {
318
- return self.bitwise_xor_(other);
319
- })
320
- .define_method(
321
- "_bitwise_xor__tensor",
322
- *[](Tensor &self, const Tensor &other) {
323
- return self.bitwise_xor_(other);
324
- })
325
- .define_method(
326
- "_bitwise_xor_scalar",
327
- *[](const Tensor &self, Scalar other) {
328
- return self.bitwise_xor(other);
329
- })
330
- .define_method(
331
- "_bitwise_xor_tensor",
332
- *[](const Tensor &self, const Tensor &other) {
333
- return self.bitwise_xor(other);
334
- })
335
- .define_method(
336
- "_bmm",
337
- *[](const Tensor &self, const Tensor &mat2) {
338
- return self.bmm(mat2);
339
- })
340
- .define_method(
341
- "_cauchy_",
342
- *[](Tensor &self, double median, double sigma) {
343
- return self.cauchy_(median, sigma);
344
- })
345
- .define_method(
346
- "_ceil",
347
- *[](const Tensor &self) {
348
- return self.ceil();
349
- })
350
- .define_method(
351
- "_ceil_",
352
- *[](Tensor &self) {
353
- return self.ceil_();
354
- })
355
- .define_method(
356
- "_cholesky",
357
- *[](const Tensor &self, bool upper) {
358
- return self.cholesky(upper);
359
- })
360
- .define_method(
361
- "_cholesky_inverse",
362
- *[](const Tensor &self, bool upper) {
363
- return self.cholesky_inverse(upper);
364
- })
365
- .define_method(
366
- "_cholesky_solve",
367
- *[](const Tensor &self, const Tensor &input2, bool upper) {
368
- return self.cholesky_solve(input2, upper);
369
- })
370
- .define_method(
371
- "_chunk",
372
- *[](Tensor &self, int64_t chunks, int64_t dim) {
373
- return self.chunk(chunks, dim);
374
- })
375
- .define_method(
376
- "_clamp_max",
377
- *[](const Tensor &self, Scalar max) {
378
- return self.clamp_max(max);
379
- })
380
- .define_method(
381
- "_clamp_max_",
382
- *[](Tensor &self, Scalar max) {
383
- return self.clamp_max_(max);
384
- })
385
- .define_method(
386
- "_clamp_min",
387
- *[](const Tensor &self, Scalar min) {
388
- return self.clamp_min(min);
389
- })
390
- .define_method(
391
- "_clamp_min_",
392
- *[](Tensor &self, Scalar min) {
393
- return self.clamp_min_(min);
394
- })
395
- .define_method(
396
- "_clone",
397
- *[](const Tensor &self) {
398
- return self.clone();
399
- })
400
- .define_method(
401
- "_coalesce",
402
- *[](const Tensor &self) {
403
- return self.coalesce();
404
- })
405
- .define_method(
406
- "_conj",
407
- *[](const Tensor &self) {
408
- return self.conj();
409
- })
410
- .define_method(
411
- "_copy_",
412
- *[](Tensor &self, const Tensor &src, bool non_blocking) {
413
- return self.copy_(src, non_blocking);
414
- })
415
- .define_method(
416
- "_cos",
417
- *[](const Tensor &self) {
418
- return self.cos();
419
- })
420
- .define_method(
421
- "_cos_",
422
- *[](Tensor &self) {
423
- return self.cos_();
424
- })
425
- .define_method(
426
- "_cosh",
427
- *[](const Tensor &self) {
428
- return self.cosh();
429
- })
430
- .define_method(
431
- "_cosh_",
432
- *[](Tensor &self) {
433
- return self.cosh_();
434
- })
435
- .define_method(
436
- "_cummax",
437
- *[](const Tensor &self, int64_t dim) {
438
- return wrap(self.cummax(dim));
439
- })
440
- .define_method(
441
- "_cummin",
442
- *[](const Tensor &self, int64_t dim) {
443
- return wrap(self.cummin(dim));
444
- })
445
- .define_method(
446
- "_cumprod",
447
- *[](const Tensor &self, int64_t dim, OptionalScalarType dtype) {
448
- return self.cumprod(dim, dtype);
449
- })
450
- .define_method(
451
- "_cumsum",
452
- *[](const Tensor &self, int64_t dim, OptionalScalarType dtype) {
453
- return self.cumsum(dim, dtype);
454
- })
455
- .define_method(
456
- "_data",
457
- *[](const Tensor &self) {
458
- return self.data();
459
- })
460
- .define_method(
461
- "_dense_dim",
462
- *[](const Tensor &self) {
463
- return self.dense_dim();
464
- })
465
- .define_method(
466
- "_dequantize",
467
- *[](const Tensor &self) {
468
- return self.dequantize();
469
- })
470
- .define_method(
471
- "_det",
472
- *[](const Tensor &self) {
473
- return self.det();
474
- })
475
- .define_method(
476
- "_detach",
477
- *[](const Tensor &self) {
478
- return self.detach();
479
- })
480
- .define_method(
481
- "_detach_",
482
- *[](Tensor &self) {
483
- return self.detach_();
484
- })
485
- .define_method(
486
- "_diag",
487
- *[](const Tensor &self, int64_t diagonal) {
488
- return self.diag(diagonal);
489
- })
490
- .define_method(
491
- "_diag_embed",
492
- *[](const Tensor &self, int64_t offset, int64_t dim1, int64_t dim2) {
493
- return self.diag_embed(offset, dim1, dim2);
494
- })
495
- .define_method(
496
- "_diagflat",
497
- *[](const Tensor &self, int64_t offset) {
498
- return self.diagflat(offset);
499
- })
500
- .define_method(
501
- "_diagonal",
502
- *[](Tensor &self, int64_t offset, int64_t dim1, int64_t dim2) {
503
- return self.diagonal(offset, dim1, dim2);
504
- })
505
- .define_method(
506
- "_digamma",
507
- *[](const Tensor &self) {
508
- return self.digamma();
509
- })
510
- .define_method(
511
- "_digamma_",
512
- *[](Tensor &self) {
513
- return self.digamma_();
514
- })
515
- .define_method(
516
- "_dist",
517
- *[](const Tensor &self, const Tensor &other, Scalar p) {
518
- return self.dist(other, p);
519
- })
520
- .define_method(
521
- "_div__scalar",
522
- *[](Tensor &self, Scalar other) {
523
- return self.div_(other);
524
- })
525
- .define_method(
526
- "_div__tensor",
527
- *[](Tensor &self, const Tensor &other) {
528
- return self.div_(other);
529
- })
530
- .define_method(
531
- "_div_scalar",
532
- *[](const Tensor &self, Scalar other) {
533
- return self.div(other);
534
- })
535
- .define_method(
536
- "_div_tensor",
537
- *[](const Tensor &self, const Tensor &other) {
538
- return self.div(other);
539
- })
540
- .define_method(
541
- "_dot",
542
- *[](const Tensor &self, const Tensor &tensor) {
543
- return self.dot(tensor);
544
- })
545
- .define_method(
546
- "_eig",
547
- *[](const Tensor &self, bool eigenvectors) {
548
- return wrap(self.eig(eigenvectors));
549
- })
550
- .define_method(
551
- "_eq__scalar",
552
- *[](Tensor &self, Scalar other) {
553
- return self.eq_(other);
554
- })
555
- .define_method(
556
- "_eq__tensor",
557
- *[](Tensor &self, const Tensor &other) {
558
- return self.eq_(other);
559
- })
560
- .define_method(
561
- "_eq_scalar",
562
- *[](const Tensor &self, Scalar other) {
563
- return self.eq(other);
564
- })
565
- .define_method(
566
- "_eq_tensor",
567
- *[](const Tensor &self, const Tensor &other) {
568
- return self.eq(other);
569
- })
570
- .define_method(
571
- "_equal",
572
- *[](const Tensor &self, const Tensor &other) {
573
- return self.equal(other);
574
- })
575
- .define_method(
576
- "_erf",
577
- *[](const Tensor &self) {
578
- return self.erf();
579
- })
580
- .define_method(
581
- "_erf_",
582
- *[](Tensor &self) {
583
- return self.erf_();
584
- })
585
- .define_method(
586
- "_erfc",
587
- *[](const Tensor &self) {
588
- return self.erfc();
589
- })
590
- .define_method(
591
- "_erfc_",
592
- *[](Tensor &self) {
593
- return self.erfc_();
594
- })
595
- .define_method(
596
- "_erfinv",
597
- *[](const Tensor &self) {
598
- return self.erfinv();
599
- })
600
- .define_method(
601
- "_erfinv_",
602
- *[](Tensor &self) {
603
- return self.erfinv_();
604
- })
605
- .define_method(
606
- "_exp",
607
- *[](const Tensor &self) {
608
- return self.exp();
609
- })
610
- .define_method(
611
- "_exp_",
612
- *[](Tensor &self) {
613
- return self.exp_();
614
- })
615
- .define_method(
616
- "_expand",
617
- *[](Tensor &self, IntArrayRef size, bool implicit) {
618
- return self.expand(size, implicit);
619
- })
620
- .define_method(
621
- "_expand_as",
622
- *[](const Tensor &self, const Tensor &other) {
623
- return self.expand_as(other);
624
- })
625
- .define_method(
626
- "_expm1",
627
- *[](const Tensor &self) {
628
- return self.expm1();
629
- })
630
- .define_method(
631
- "_expm1_",
632
- *[](Tensor &self) {
633
- return self.expm1_();
634
- })
635
- .define_method(
636
- "_exponential_",
637
- *[](Tensor &self, double lambd) {
638
- return self.exponential_(lambd);
639
- })
640
- .define_method(
641
- "_fft",
642
- *[](const Tensor &self, int64_t signal_ndim, bool normalized) {
643
- return self.fft(signal_ndim, normalized);
644
- })
645
- .define_method(
646
- "_fill__scalar",
647
- *[](Tensor &self, Scalar value) {
648
- return self.fill_(value);
649
- })
650
- .define_method(
651
- "_fill__tensor",
652
- *[](Tensor &self, const Tensor &value) {
653
- return self.fill_(value);
654
- })
655
- .define_method(
656
- "_fill_diagonal_",
657
- *[](Tensor &self, Scalar fill_value, bool wrap) {
658
- return self.fill_diagonal_(fill_value, wrap);
659
- })
660
- .define_method(
661
- "_flatten_using_ints",
662
- *[](const Tensor &self, int64_t start_dim, int64_t end_dim) {
663
- return self.flatten(start_dim, end_dim);
664
- })
665
- .define_method(
666
- "_flip",
667
- *[](const Tensor &self, IntArrayRef dims) {
668
- return self.flip(dims);
669
- })
670
- .define_method(
671
- "_floor",
672
- *[](const Tensor &self) {
673
- return self.floor();
674
- })
675
- .define_method(
676
- "_floor_",
677
- *[](Tensor &self) {
678
- return self.floor_();
679
- })
680
- .define_method(
681
- "_floor_divide",
682
- *[](const Tensor &self, const Tensor &other) {
683
- return self.floor_divide(other);
684
- })
685
- .define_method(
686
- "_floor_divide__scalar",
687
- *[](Tensor &self, Scalar other) {
688
- return self.floor_divide_(other);
689
- })
690
- .define_method(
691
- "_floor_divide__tensor",
692
- *[](Tensor &self, const Tensor &other) {
693
- return self.floor_divide_(other);
694
- })
695
- .define_method(
696
- "_floor_divide_scalar",
697
- *[](const Tensor &self, Scalar other) {
698
- return self.floor_divide(other);
699
- })
700
- .define_method(
701
- "_fmod__scalar",
702
- *[](Tensor &self, Scalar other) {
703
- return self.fmod_(other);
704
- })
705
- .define_method(
706
- "_fmod__tensor",
707
- *[](Tensor &self, const Tensor &other) {
708
- return self.fmod_(other);
709
- })
710
- .define_method(
711
- "_fmod_scalar",
712
- *[](const Tensor &self, Scalar other) {
713
- return self.fmod(other);
714
- })
715
- .define_method(
716
- "_fmod_tensor",
717
- *[](const Tensor &self, const Tensor &other) {
718
- return self.fmod(other);
719
- })
720
- .define_method(
721
- "_frac",
722
- *[](const Tensor &self) {
723
- return self.frac();
724
- })
725
- .define_method(
726
- "_frac_",
727
- *[](Tensor &self) {
728
- return self.frac_();
729
- })
730
- .define_method(
731
- "_gather",
732
- *[](const Tensor &self, int64_t dim, const Tensor &index, bool sparse_grad) {
733
- return self.gather(dim, index, sparse_grad);
734
- })
735
- .define_method(
736
- "_ge__scalar",
737
- *[](Tensor &self, Scalar other) {
738
- return self.ge_(other);
739
- })
740
- .define_method(
741
- "_ge__tensor",
742
- *[](Tensor &self, const Tensor &other) {
743
- return self.ge_(other);
744
- })
745
- .define_method(
746
- "_ge_scalar",
747
- *[](const Tensor &self, Scalar other) {
748
- return self.ge(other);
749
- })
750
- .define_method(
751
- "_ge_tensor",
752
- *[](const Tensor &self, const Tensor &other) {
753
- return self.ge(other);
754
- })
755
- .define_method(
756
- "_geometric_",
757
- *[](Tensor &self, double p) {
758
- return self.geometric_(p);
759
- })
760
- .define_method(
761
- "_geqrf",
762
- *[](const Tensor &self) {
763
- return wrap(self.geqrf());
764
- })
765
- .define_method(
766
- "_ger",
767
- *[](const Tensor &self, const Tensor &vec2) {
768
- return self.ger(vec2);
769
- })
770
- .define_method(
771
- "_gt__scalar",
772
- *[](Tensor &self, Scalar other) {
773
- return self.gt_(other);
774
- })
775
- .define_method(
776
- "_gt__tensor",
777
- *[](Tensor &self, const Tensor &other) {
778
- return self.gt_(other);
779
- })
780
- .define_method(
781
- "_gt_scalar",
782
- *[](const Tensor &self, Scalar other) {
783
- return self.gt(other);
784
- })
785
- .define_method(
786
- "_gt_tensor",
787
- *[](const Tensor &self, const Tensor &other) {
788
- return self.gt(other);
789
- })
790
- .define_method(
791
- "_hardshrink",
792
- *[](const Tensor &self, Scalar lambd) {
793
- return self.hardshrink(lambd);
794
- })
795
- .define_method(
796
- "_histc",
797
- *[](const Tensor &self, int64_t bins, Scalar min, Scalar max) {
798
- return self.histc(bins, min, max);
799
- })
800
- .define_method(
801
- "_ifft",
802
- *[](const Tensor &self, int64_t signal_ndim, bool normalized) {
803
- return self.ifft(signal_ndim, normalized);
804
- })
805
- .define_method(
806
- "_index_add",
807
- *[](const Tensor &self, int64_t dim, const Tensor &index, const Tensor &source) {
808
- return self.index_add(dim, index, source);
809
- })
810
- .define_method(
811
- "_index_add_",
812
- *[](Tensor &self, int64_t dim, const Tensor &index, const Tensor &source) {
813
- return self.index_add_(dim, index, source);
814
- })
815
- .define_method(
816
- "_index_copy",
817
- *[](const Tensor &self, int64_t dim, const Tensor &index, const Tensor &source) {
818
- return self.index_copy(dim, index, source);
819
- })
820
- .define_method(
821
- "_index_copy_",
822
- *[](Tensor &self, int64_t dim, const Tensor &index, const Tensor &source) {
823
- return self.index_copy_(dim, index, source);
824
- })
825
- .define_method(
826
- "_index_fill__int_scalar",
827
- *[](Tensor &self, int64_t dim, const Tensor &index, Scalar value) {
828
- return self.index_fill_(dim, index, value);
829
- })
830
- .define_method(
831
- "_index_fill__int_tensor",
832
- *[](Tensor &self, int64_t dim, const Tensor &index, const Tensor &value) {
833
- return self.index_fill_(dim, index, value);
834
- })
835
- .define_method(
836
- "_index_fill_int_scalar",
837
- *[](const Tensor &self, int64_t dim, const Tensor &index, Scalar value) {
838
- return self.index_fill(dim, index, value);
839
- })
840
- .define_method(
841
- "_index_fill_int_tensor",
842
- *[](const Tensor &self, int64_t dim, const Tensor &index, const Tensor &value) {
843
- return self.index_fill(dim, index, value);
844
- })
845
- .define_method(
846
- "_index_select",
847
- *[](const Tensor &self, int64_t dim, const Tensor &index) {
848
- return self.index_select(dim, index);
849
- })
850
- .define_method(
851
- "_indices",
852
- *[](Tensor &self) {
853
- return self.indices();
854
- })
855
- .define_method(
856
- "_int_repr",
857
- *[](const Tensor &self) {
858
- return self.int_repr();
859
- })
860
- .define_method(
861
- "_inverse",
862
- *[](const Tensor &self) {
863
- return self.inverse();
864
- })
865
- .define_method(
866
- "_irfft",
867
- *[](const Tensor &self, int64_t signal_ndim, bool normalized, bool onesided, IntArrayRef signal_sizes) {
868
- return self.irfft(signal_ndim, normalized, onesided, signal_sizes);
869
- })
870
- .define_method(
871
- "_is_coalesced",
872
- *[](const Tensor &self) {
873
- return self.is_coalesced();
874
- })
875
- .define_method(
876
- "_is_complex",
877
- *[](const Tensor &self) {
878
- return self.is_complex();
879
- })
880
- .define_method(
881
- "_is_distributed",
882
- *[](const Tensor &self) {
883
- return self.is_distributed();
884
- })
885
- .define_method(
886
- "_is_floating_point",
887
- *[](const Tensor &self) {
888
- return self.is_floating_point();
889
- })
890
- .define_method(
891
- "_is_leaf",
892
- *[](const Tensor &self) {
893
- return self.is_leaf();
894
- })
895
- .define_method(
896
- "_is_nonzero",
897
- *[](const Tensor &self) {
898
- return self.is_nonzero();
899
- })
900
- .define_method(
901
- "_is_pinned",
902
- *[](const Tensor &self) {
903
- return self.is_pinned();
904
- })
905
- .define_method(
906
- "_is_same_size",
907
- *[](const Tensor &self, const Tensor &other) {
908
- return self.is_same_size(other);
909
- })
910
- .define_method(
911
- "_is_set_to",
912
- *[](const Tensor &self, const Tensor &tensor) {
913
- return self.is_set_to(tensor);
914
- })
915
- .define_method(
916
- "_is_signed",
917
- *[](const Tensor &self) {
918
- return self.is_signed();
919
- })
920
- .define_method(
921
- "_isclose",
922
- *[](const Tensor &self, const Tensor &other, double rtol, double atol, bool equal_nan) {
923
- return self.isclose(other, rtol, atol, equal_nan);
924
- })
925
- .define_method(
926
- "_item",
927
- *[](const Tensor &self) {
928
- return self.item();
929
- })
930
- .define_method(
931
- "_kthvalue",
932
- *[](const Tensor &self, int64_t k, int64_t dim, bool keepdim) {
933
- return wrap(self.kthvalue(k, dim, keepdim));
934
- })
935
- .define_method(
936
- "_le__scalar",
937
- *[](Tensor &self, Scalar other) {
938
- return self.le_(other);
939
- })
940
- .define_method(
941
- "_le__tensor",
942
- *[](Tensor &self, const Tensor &other) {
943
- return self.le_(other);
944
- })
945
- .define_method(
946
- "_le_scalar",
947
- *[](const Tensor &self, Scalar other) {
948
- return self.le(other);
949
- })
950
- .define_method(
951
- "_le_tensor",
952
- *[](const Tensor &self, const Tensor &other) {
953
- return self.le(other);
954
- })
955
- .define_method(
956
- "_lerp__scalar",
957
- *[](Tensor &self, const Tensor &end, Scalar weight) {
958
- return self.lerp_(end, weight);
959
- })
960
- .define_method(
961
- "_lerp__tensor",
962
- *[](Tensor &self, const Tensor &end, const Tensor &weight) {
963
- return self.lerp_(end, weight);
964
- })
965
- .define_method(
966
- "_lerp_scalar",
967
- *[](const Tensor &self, const Tensor &end, Scalar weight) {
968
- return self.lerp(end, weight);
969
- })
970
- .define_method(
971
- "_lerp_tensor",
972
- *[](const Tensor &self, const Tensor &end, const Tensor &weight) {
973
- return self.lerp(end, weight);
974
- })
975
- .define_method(
976
- "_lgamma",
977
- *[](const Tensor &self) {
978
- return self.lgamma();
979
- })
980
- .define_method(
981
- "_lgamma_",
982
- *[](Tensor &self) {
983
- return self.lgamma_();
984
- })
985
- .define_method(
986
- "_log",
987
- *[](const Tensor &self) {
988
- return self.log();
989
- })
990
- .define_method(
991
- "_log10",
992
- *[](const Tensor &self) {
993
- return self.log10();
994
- })
995
- .define_method(
996
- "_log10_",
997
- *[](Tensor &self) {
998
- return self.log10_();
999
- })
1000
- .define_method(
1001
- "_log1p",
1002
- *[](const Tensor &self) {
1003
- return self.log1p();
1004
- })
1005
- .define_method(
1006
- "_log1p_",
1007
- *[](Tensor &self) {
1008
- return self.log1p_();
1009
- })
1010
- .define_method(
1011
- "_log2",
1012
- *[](const Tensor &self) {
1013
- return self.log2();
1014
- })
1015
- .define_method(
1016
- "_log2_",
1017
- *[](Tensor &self) {
1018
- return self.log2_();
1019
- })
1020
- .define_method(
1021
- "_log_",
1022
- *[](Tensor &self) {
1023
- return self.log_();
1024
- })
1025
- .define_method(
1026
- "_log_normal_",
1027
- *[](Tensor &self, double mean, double std) {
1028
- return self.log_normal_(mean, std);
1029
- })
1030
- .define_method(
1031
- "_log_softmax_int",
1032
- *[](const Tensor &self, int64_t dim, OptionalScalarType dtype) {
1033
- return self.log_softmax(dim, dtype);
1034
- })
1035
- .define_method(
1036
- "_logdet",
1037
- *[](const Tensor &self) {
1038
- return self.logdet();
1039
- })
1040
- .define_method(
1041
- "_logical_and",
1042
- *[](const Tensor &self, const Tensor &other) {
1043
- return self.logical_and(other);
1044
- })
1045
- .define_method(
1046
- "_logical_and_",
1047
- *[](Tensor &self, const Tensor &other) {
1048
- return self.logical_and_(other);
1049
- })
1050
- .define_method(
1051
- "_logical_not",
1052
- *[](const Tensor &self) {
1053
- return self.logical_not();
1054
- })
1055
- .define_method(
1056
- "_logical_not_",
1057
- *[](Tensor &self) {
1058
- return self.logical_not_();
1059
- })
1060
- .define_method(
1061
- "_logical_or",
1062
- *[](const Tensor &self, const Tensor &other) {
1063
- return self.logical_or(other);
1064
- })
1065
- .define_method(
1066
- "_logical_or_",
1067
- *[](Tensor &self, const Tensor &other) {
1068
- return self.logical_or_(other);
1069
- })
1070
- .define_method(
1071
- "_logical_xor",
1072
- *[](const Tensor &self, const Tensor &other) {
1073
- return self.logical_xor(other);
1074
- })
1075
- .define_method(
1076
- "_logical_xor_",
1077
- *[](Tensor &self, const Tensor &other) {
1078
- return self.logical_xor_(other);
1079
- })
1080
- .define_method(
1081
- "_logsumexp",
1082
- *[](const Tensor &self, IntArrayRef dim, bool keepdim) {
1083
- return self.logsumexp(dim, keepdim);
1084
- })
1085
- .define_method(
1086
- "_lstsq",
1087
- *[](const Tensor &self, const Tensor &A) {
1088
- return wrap(self.lstsq(A));
1089
- })
1090
- .define_method(
1091
- "_lt__scalar",
1092
- *[](Tensor &self, Scalar other) {
1093
- return self.lt_(other);
1094
- })
1095
- .define_method(
1096
- "_lt__tensor",
1097
- *[](Tensor &self, const Tensor &other) {
1098
- return self.lt_(other);
1099
- })
1100
- .define_method(
1101
- "_lt_scalar",
1102
- *[](const Tensor &self, Scalar other) {
1103
- return self.lt(other);
1104
- })
1105
- .define_method(
1106
- "_lt_tensor",
1107
- *[](const Tensor &self, const Tensor &other) {
1108
- return self.lt(other);
1109
- })
1110
- .define_method(
1111
- "_lu_solve",
1112
- *[](const Tensor &self, const Tensor &LU_data, const Tensor &LU_pivots) {
1113
- return self.lu_solve(LU_data, LU_pivots);
1114
- })
1115
- .define_method(
1116
- "_masked_fill__scalar",
1117
- *[](Tensor &self, const Tensor &mask, Scalar value) {
1118
- return self.masked_fill_(mask, value);
1119
- })
1120
- .define_method(
1121
- "_masked_fill__tensor",
1122
- *[](Tensor &self, const Tensor &mask, const Tensor &value) {
1123
- return self.masked_fill_(mask, value);
1124
- })
1125
- .define_method(
1126
- "_masked_fill_scalar",
1127
- *[](const Tensor &self, const Tensor &mask, Scalar value) {
1128
- return self.masked_fill(mask, value);
1129
- })
1130
- .define_method(
1131
- "_masked_fill_tensor",
1132
- *[](const Tensor &self, const Tensor &mask, const Tensor &value) {
1133
- return self.masked_fill(mask, value);
1134
- })
1135
- .define_method(
1136
- "_masked_scatter",
1137
- *[](const Tensor &self, const Tensor &mask, const Tensor &source) {
1138
- return self.masked_scatter(mask, source);
1139
- })
1140
- .define_method(
1141
- "_masked_scatter_",
1142
- *[](Tensor &self, const Tensor &mask, const Tensor &source) {
1143
- return self.masked_scatter_(mask, source);
1144
- })
1145
- .define_method(
1146
- "_masked_select",
1147
- *[](const Tensor &self, const Tensor &mask) {
1148
- return self.masked_select(mask);
1149
- })
1150
- .define_method(
1151
- "_matmul",
1152
- *[](const Tensor &self, const Tensor &other) {
1153
- return self.matmul(other);
1154
- })
1155
- .define_method(
1156
- "_matrix_power",
1157
- *[](const Tensor &self, int64_t n) {
1158
- return self.matrix_power(n);
1159
- })
1160
- .define_method(
1161
- "_max",
1162
- *[](const Tensor &self) {
1163
- return self.max();
1164
- })
1165
- .define_method(
1166
- "_max_dim",
1167
- *[](const Tensor &self, int64_t dim, bool keepdim) {
1168
- return wrap(self.max(dim, keepdim));
1169
- })
1170
- .define_method(
1171
- "_max_other",
1172
- *[](const Tensor &self, const Tensor &other) {
1173
- return self.max(other);
1174
- })
1175
- .define_method(
1176
- "_max_values",
1177
- *[](const Tensor &self, IntArrayRef dim, bool keepdim) {
1178
- return self.max_values(dim, keepdim);
1179
- })
1180
- .define_method(
1181
- "_mean",
1182
- *[](const Tensor &self, OptionalScalarType dtype) {
1183
- return self.mean(dtype);
1184
- })
1185
- .define_method(
1186
- "_mean_dim",
1187
- *[](const Tensor &self, IntArrayRef dim, bool keepdim, OptionalScalarType dtype) {
1188
- return self.mean(dim, keepdim, dtype);
1189
- })
1190
- .define_method(
1191
- "_median",
1192
- *[](const Tensor &self) {
1193
- return self.median();
1194
- })
1195
- .define_method(
1196
- "_median_dim",
1197
- *[](const Tensor &self, int64_t dim, bool keepdim) {
1198
- return wrap(self.median(dim, keepdim));
1199
- })
1200
- .define_method(
1201
- "_min",
1202
- *[](const Tensor &self) {
1203
- return self.min();
1204
- })
1205
- .define_method(
1206
- "_min_dim",
1207
- *[](const Tensor &self, int64_t dim, bool keepdim) {
1208
- return wrap(self.min(dim, keepdim));
1209
- })
1210
- .define_method(
1211
- "_min_other",
1212
- *[](const Tensor &self, const Tensor &other) {
1213
- return self.min(other);
1214
- })
1215
- .define_method(
1216
- "_min_values",
1217
- *[](const Tensor &self, IntArrayRef dim, bool keepdim) {
1218
- return self.min_values(dim, keepdim);
1219
- })
1220
- .define_method(
1221
- "_mm",
1222
- *[](const Tensor &self, const Tensor &mat2) {
1223
- return self.mm(mat2);
1224
- })
1225
- .define_method(
1226
- "_mode",
1227
- *[](const Tensor &self, int64_t dim, bool keepdim) {
1228
- return wrap(self.mode(dim, keepdim));
1229
- })
1230
- .define_method(
1231
- "_mul__scalar",
1232
- *[](Tensor &self, Scalar other) {
1233
- return self.mul_(other);
1234
- })
1235
- .define_method(
1236
- "_mul__tensor",
1237
- *[](Tensor &self, const Tensor &other) {
1238
- return self.mul_(other);
1239
- })
1240
- .define_method(
1241
- "_mul_scalar",
1242
- *[](const Tensor &self, Scalar other) {
1243
- return self.mul(other);
1244
- })
1245
- .define_method(
1246
- "_mul_tensor",
1247
- *[](const Tensor &self, const Tensor &other) {
1248
- return self.mul(other);
1249
- })
1250
- .define_method(
1251
- "_multinomial",
1252
- *[](const Tensor &self, int64_t num_samples, bool replacement) {
1253
- return self.multinomial(num_samples, replacement);
1254
- })
1255
- .define_method(
1256
- "_mv",
1257
- *[](const Tensor &self, const Tensor &vec) {
1258
- return self.mv(vec);
1259
- })
1260
- .define_method(
1261
- "_mvlgamma",
1262
- *[](const Tensor &self, int64_t p) {
1263
- return self.mvlgamma(p);
1264
- })
1265
- .define_method(
1266
- "_mvlgamma_",
1267
- *[](Tensor &self, int64_t p) {
1268
- return self.mvlgamma_(p);
1269
- })
1270
- .define_method(
1271
- "_narrow",
1272
- *[](Tensor &self, int64_t dim, int64_t start, int64_t length) {
1273
- return self.narrow(dim, start, length);
1274
- })
1275
- .define_method(
1276
- "_narrow_copy",
1277
- *[](const Tensor &self, int64_t dim, int64_t start, int64_t length) {
1278
- return self.narrow_copy(dim, start, length);
1279
- })
1280
- .define_method(
1281
- "_narrow_tensor",
1282
- *[](Tensor &self, int64_t dim, const Tensor &start, int64_t length) {
1283
- return self.narrow(dim, start, length);
1284
- })
1285
- .define_method(
1286
- "_ne__scalar",
1287
- *[](Tensor &self, Scalar other) {
1288
- return self.ne_(other);
1289
- })
1290
- .define_method(
1291
- "_ne__tensor",
1292
- *[](Tensor &self, const Tensor &other) {
1293
- return self.ne_(other);
1294
- })
1295
- .define_method(
1296
- "_ne_scalar",
1297
- *[](const Tensor &self, Scalar other) {
1298
- return self.ne(other);
1299
- })
1300
- .define_method(
1301
- "_ne_tensor",
1302
- *[](const Tensor &self, const Tensor &other) {
1303
- return self.ne(other);
1304
- })
1305
- .define_method(
1306
- "_neg",
1307
- *[](const Tensor &self) {
1308
- return self.neg();
1309
- })
1310
- .define_method(
1311
- "_neg_",
1312
- *[](Tensor &self) {
1313
- return self.neg_();
1314
- })
1315
- .define_method(
1316
- "_nonzero",
1317
- *[](const Tensor &self) {
1318
- return self.nonzero();
1319
- })
1320
- .define_method(
1321
- "_nonzero_numpy",
1322
- *[](const Tensor &self) {
1323
- return self.nonzero_numpy();
1324
- })
1325
- .define_method(
1326
- "_norm_scalar",
1327
- *[](const Tensor &self, Scalar p) {
1328
- return self.norm(p);
1329
- })
1330
- .define_method(
1331
- "_normal_",
1332
- *[](Tensor &self, double mean, double std) {
1333
- return self.normal_(mean, std);
1334
- })
1335
- .define_method(
1336
- "_numpy_t",
1337
- *[](Tensor &self) {
1338
- return self.numpy_T();
1339
- })
1340
- .define_method(
1341
- "_orgqr",
1342
- *[](const Tensor &self, const Tensor &input2) {
1343
- return self.orgqr(input2);
1344
- })
1345
- .define_method(
1346
- "_ormqr",
1347
- *[](const Tensor &self, const Tensor &input2, const Tensor &input3, bool left, bool transpose) {
1348
- return self.ormqr(input2, input3, left, transpose);
1349
- })
1350
- .define_method(
1351
- "_output_nr",
1352
- *[](const Tensor &self) {
1353
- return self.output_nr();
1354
- })
1355
- .define_method(
1356
- "_permute",
1357
- *[](Tensor &self, IntArrayRef dims) {
1358
- return self.permute(dims);
1359
- })
1360
- .define_method(
1361
- "_pin_memory",
1362
- *[](const Tensor &self) {
1363
- return self.pin_memory();
1364
- })
1365
- .define_method(
1366
- "_pinverse",
1367
- *[](const Tensor &self, double rcond) {
1368
- return self.pinverse(rcond);
1369
- })
1370
- .define_method(
1371
- "_polygamma",
1372
- *[](int64_t n, const Tensor &self) {
1373
- return self.polygamma(n);
1374
- })
1375
- .define_method(
1376
- "_polygamma_",
1377
- *[](Tensor &self, int64_t n) {
1378
- return self.polygamma_(n);
1379
- })
1380
- .define_method(
1381
- "_pow__scalar",
1382
- *[](Tensor &self, Scalar exponent) {
1383
- return self.pow_(exponent);
1384
- })
1385
- .define_method(
1386
- "_pow__tensor",
1387
- *[](Tensor &self, const Tensor &exponent) {
1388
- return self.pow_(exponent);
1389
- })
1390
- .define_method(
1391
- "_pow_tensor_scalar",
1392
- *[](const Tensor &self, Scalar exponent) {
1393
- return self.pow(exponent);
1394
- })
1395
- .define_method(
1396
- "_pow_tensor_tensor",
1397
- *[](const Tensor &self, const Tensor &exponent) {
1398
- return self.pow(exponent);
1399
- })
1400
- .define_method(
1401
- "_prelu",
1402
- *[](const Tensor &self, const Tensor &weight) {
1403
- return self.prelu(weight);
1404
- })
1405
- .define_method(
1406
- "_prod",
1407
- *[](const Tensor &self, OptionalScalarType dtype) {
1408
- return self.prod(dtype);
1409
- })
1410
- .define_method(
1411
- "_prod_dim_int",
1412
- *[](const Tensor &self, int64_t dim, bool keepdim, OptionalScalarType dtype) {
1413
- return self.prod(dim, keepdim, dtype);
1414
- })
1415
- .define_method(
1416
- "_put_",
1417
- *[](Tensor &self, const Tensor &index, const Tensor &source, bool accumulate) {
1418
- return self.put_(index, source, accumulate);
1419
- })
1420
- .define_method(
1421
- "_q_per_channel_axis",
1422
- *[](const Tensor &self) {
1423
- return self.q_per_channel_axis();
1424
- })
1425
- .define_method(
1426
- "_q_per_channel_scales",
1427
- *[](const Tensor &self) {
1428
- return self.q_per_channel_scales();
1429
- })
1430
- .define_method(
1431
- "_q_per_channel_zero_points",
1432
- *[](const Tensor &self) {
1433
- return self.q_per_channel_zero_points();
1434
- })
1435
- .define_method(
1436
- "_q_scale",
1437
- *[](const Tensor &self) {
1438
- return self.q_scale();
1439
- })
1440
- .define_method(
1441
- "_q_zero_point",
1442
- *[](const Tensor &self) {
1443
- return self.q_zero_point();
1444
- })
1445
- .define_method(
1446
- "_qr",
1447
- *[](const Tensor &self, bool some) {
1448
- return wrap(self.qr(some));
1449
- })
1450
- .define_method(
1451
- "_qscheme",
1452
- *[](const Tensor &self) {
1453
- return self.qscheme();
1454
- })
1455
- .define_method(
1456
- "_random_",
1457
- *[](Tensor &self) {
1458
- return self.random_();
1459
- })
1460
- .define_method(
1461
- "_random__from",
1462
- *[](Tensor &self, int64_t from) {
1463
- return self.random_(from);
1464
- })
1465
- .define_method(
1466
- "_random__from_to",
1467
- *[](Tensor &self, int64_t from, int64_t to) {
1468
- return self.random_(from, to);
1469
- })
1470
- .define_method(
1471
- "_random__to",
1472
- *[](Tensor &self, int64_t to) {
1473
- return self.random_(to);
1474
- })
1475
- .define_method(
1476
- "_reciprocal",
1477
- *[](const Tensor &self) {
1478
- return self.reciprocal();
1479
- })
1480
- .define_method(
1481
- "_reciprocal_",
1482
- *[](Tensor &self) {
1483
- return self.reciprocal_();
1484
- })
1485
- .define_method(
1486
- "_relu",
1487
- *[](const Tensor &self) {
1488
- return self.relu();
1489
- })
1490
- .define_method(
1491
- "_relu_",
1492
- *[](Tensor &self) {
1493
- return self.relu_();
1494
- })
1495
- .define_method(
1496
- "_remainder__scalar",
1497
- *[](Tensor &self, Scalar other) {
1498
- return self.remainder_(other);
1499
- })
1500
- .define_method(
1501
- "_remainder__tensor",
1502
- *[](Tensor &self, const Tensor &other) {
1503
- return self.remainder_(other);
1504
- })
1505
- .define_method(
1506
- "_remainder_scalar",
1507
- *[](const Tensor &self, Scalar other) {
1508
- return self.remainder(other);
1509
- })
1510
- .define_method(
1511
- "_remainder_tensor",
1512
- *[](const Tensor &self, const Tensor &other) {
1513
- return self.remainder(other);
1514
- })
1515
- .define_method(
1516
- "_renorm",
1517
- *[](const Tensor &self, Scalar p, int64_t dim, Scalar maxnorm) {
1518
- return self.renorm(p, dim, maxnorm);
1519
- })
1520
- .define_method(
1521
- "_renorm_",
1522
- *[](Tensor &self, Scalar p, int64_t dim, Scalar maxnorm) {
1523
- return self.renorm_(p, dim, maxnorm);
1524
- })
1525
- .define_method(
1526
- "_repeat",
1527
- *[](const Tensor &self, IntArrayRef repeats) {
1528
- return self.repeat(repeats);
1529
- })
1530
- .define_method(
1531
- "_repeat_interleave_self_int",
1532
- *[](const Tensor &self, int64_t repeats) {
1533
- return self.repeat_interleave(repeats);
1534
- })
1535
- .define_method(
1536
- "_repeat_interleave_self_int_dim",
1537
- *[](const Tensor &self, int64_t repeats, int64_t dim) {
1538
- return self.repeat_interleave(repeats, dim);
1539
- })
1540
- .define_method(
1541
- "_repeat_interleave_self_tensor",
1542
- *[](const Tensor &self, const Tensor &repeats) {
1543
- return self.repeat_interleave(repeats);
1544
- })
1545
- .define_method(
1546
- "_repeat_interleave_self_tensor_dim",
1547
- *[](const Tensor &self, const Tensor &repeats, int64_t dim) {
1548
- return self.repeat_interleave(repeats, dim);
1549
- })
1550
- .define_method(
1551
- "_requires_grad_",
1552
- *[](Tensor &self, bool _requires_grad) {
1553
- return self.requires_grad_(_requires_grad);
1554
- })
1555
- .define_method(
1556
- "_reshape",
1557
- *[](const Tensor &self, IntArrayRef shape) {
1558
- return self.reshape(shape);
1559
- })
1560
- .define_method(
1561
- "_reshape_as",
1562
- *[](const Tensor &self, const Tensor &other) {
1563
- return self.reshape_as(other);
1564
- })
1565
- .define_method(
1566
- "_resize_",
1567
- *[](Tensor &self, IntArrayRef size) {
1568
- return self.resize_(size);
1569
- })
1570
- .define_method(
1571
- "_resize_as_",
1572
- *[](Tensor &self, const Tensor &the_template) {
1573
- return self.resize_as_(the_template);
1574
- })
1575
- .define_method(
1576
- "_retain_grad",
1577
- *[](Tensor &self) {
1578
- return self.retain_grad();
1579
- })
1580
- .define_method(
1581
- "_rfft",
1582
- *[](const Tensor &self, int64_t signal_ndim, bool normalized, bool onesided) {
1583
- return self.rfft(signal_ndim, normalized, onesided);
1584
- })
1585
- .define_method(
1586
- "_roll",
1587
- *[](const Tensor &self, IntArrayRef shifts, IntArrayRef dims) {
1588
- return self.roll(shifts, dims);
1589
- })
1590
- .define_method(
1591
- "_rot90",
1592
- *[](const Tensor &self, int64_t k, IntArrayRef dims) {
1593
- return self.rot90(k, dims);
1594
- })
1595
- .define_method(
1596
- "_round",
1597
- *[](const Tensor &self) {
1598
- return self.round();
1599
- })
1600
- .define_method(
1601
- "_round_",
1602
- *[](Tensor &self) {
1603
- return self.round_();
1604
- })
1605
- .define_method(
1606
- "_rsqrt",
1607
- *[](const Tensor &self) {
1608
- return self.rsqrt();
1609
- })
1610
- .define_method(
1611
- "_rsqrt_",
1612
- *[](Tensor &self) {
1613
- return self.rsqrt_();
1614
- })
1615
- .define_method(
1616
- "_scatter__src",
1617
- *[](Tensor &self, int64_t dim, const Tensor &index, const Tensor &src) {
1618
- return self.scatter_(dim, index, src);
1619
- })
1620
- .define_method(
1621
- "_scatter__value",
1622
- *[](Tensor &self, int64_t dim, const Tensor &index, Scalar value) {
1623
- return self.scatter_(dim, index, value);
1624
- })
1625
- .define_method(
1626
- "_scatter_add",
1627
- *[](const Tensor &self, int64_t dim, const Tensor &index, const Tensor &src) {
1628
- return self.scatter_add(dim, index, src);
1629
- })
1630
- .define_method(
1631
- "_scatter_add_",
1632
- *[](Tensor &self, int64_t dim, const Tensor &index, const Tensor &src) {
1633
- return self.scatter_add_(dim, index, src);
1634
- })
1635
- .define_method(
1636
- "_scatter_src",
1637
- *[](const Tensor &self, int64_t dim, const Tensor &index, const Tensor &src) {
1638
- return self.scatter(dim, index, src);
1639
- })
1640
- .define_method(
1641
- "_scatter_value",
1642
- *[](const Tensor &self, int64_t dim, const Tensor &index, Scalar value) {
1643
- return self.scatter(dim, index, value);
1644
- })
1645
- .define_method(
1646
- "_select_int",
1647
- *[](Tensor &self, int64_t dim, int64_t index) {
1648
- return self.select(dim, index);
1649
- })
1650
- .define_method(
1651
- "_set_",
1652
- *[](Tensor &self) {
1653
- return self.set_();
1654
- })
1655
- .define_method(
1656
- "_set__source_tensor",
1657
- *[](Tensor &self, const Tensor &source) {
1658
- return self.set_(source);
1659
- })
1660
- .define_method(
1661
- "_set_data",
1662
- *[](Tensor &self, const Tensor &new_data) {
1663
- return self.set_data(new_data);
1664
- })
1665
- .define_method(
1666
- "_sigmoid",
1667
- *[](const Tensor &self) {
1668
- return self.sigmoid();
1669
- })
1670
- .define_method(
1671
- "_sigmoid_",
1672
- *[](Tensor &self) {
1673
- return self.sigmoid_();
1674
- })
1675
- .define_method(
1676
- "_sign",
1677
- *[](const Tensor &self) {
1678
- return self.sign();
1679
- })
1680
- .define_method(
1681
- "_sign_",
1682
- *[](Tensor &self) {
1683
- return self.sign_();
1684
- })
1685
- .define_method(
1686
- "_sin",
1687
- *[](const Tensor &self) {
1688
- return self.sin();
1689
- })
1690
- .define_method(
1691
- "_sin_",
1692
- *[](Tensor &self) {
1693
- return self.sin_();
1694
- })
1695
- .define_method(
1696
- "_sinh",
1697
- *[](const Tensor &self) {
1698
- return self.sinh();
1699
- })
1700
- .define_method(
1701
- "_sinh_",
1702
- *[](Tensor &self) {
1703
- return self.sinh_();
1704
- })
1705
- .define_method(
1706
- "_size_int",
1707
- *[](const Tensor &self, int64_t dim) {
1708
- return self.size(dim);
1709
- })
1710
- .define_method(
1711
- "_slice_tensor",
1712
- *[](Tensor &self, int64_t dim, int64_t start, int64_t end, int64_t step) {
1713
- return self.slice(dim, start, end, step);
1714
- })
1715
- .define_method(
1716
- "_slogdet",
1717
- *[](const Tensor &self) {
1718
- return wrap(self.slogdet());
1719
- })
1720
- .define_method(
1721
- "_smm",
1722
- *[](const Tensor &self, const Tensor &mat2) {
1723
- return self.smm(mat2);
1724
- })
1725
- .define_method(
1726
- "_softmax_int",
1727
- *[](const Tensor &self, int64_t dim, OptionalScalarType dtype) {
1728
- return self.softmax(dim, dtype);
1729
- })
1730
- .define_method(
1731
- "_solve",
1732
- *[](const Tensor &self, const Tensor &A) {
1733
- return wrap(self.solve(A));
1734
- })
1735
- .define_method(
1736
- "_sort",
1737
- *[](const Tensor &self, int64_t dim, bool descending) {
1738
- return wrap(self.sort(dim, descending));
1739
- })
1740
- .define_method(
1741
- "_sparse_dim",
1742
- *[](const Tensor &self) {
1743
- return self.sparse_dim();
1744
- })
1745
- .define_method(
1746
- "_sparse_mask",
1747
- *[](const Tensor &self, const Tensor &mask) {
1748
- return self.sparse_mask(mask);
1749
- })
1750
- .define_method(
1751
- "_sparse_resize_",
1752
- *[](Tensor &self, IntArrayRef size, int64_t sparse_dim, int64_t dense_dim) {
1753
- return self.sparse_resize_(size, sparse_dim, dense_dim);
1754
- })
1755
- .define_method(
1756
- "_sparse_resize_and_clear_",
1757
- *[](Tensor &self, IntArrayRef size, int64_t sparse_dim, int64_t dense_dim) {
1758
- return self.sparse_resize_and_clear_(size, sparse_dim, dense_dim);
1759
- })
1760
- .define_method(
1761
- "_split_tensor",
1762
- *[](Tensor &self, int64_t split_size, int64_t dim) {
1763
- return self.split(split_size, dim);
1764
- })
1765
- .define_method(
1766
- "_split_with_sizes",
1767
- *[](const Tensor &self, IntArrayRef split_sizes, int64_t dim) {
1768
- return self.split_with_sizes(split_sizes, dim);
1769
- })
1770
- .define_method(
1771
- "_sqrt",
1772
- *[](const Tensor &self) {
1773
- return self.sqrt();
1774
- })
1775
- .define_method(
1776
- "_sqrt_",
1777
- *[](Tensor &self) {
1778
- return self.sqrt_();
1779
- })
1780
- .define_method(
1781
- "_square",
1782
- *[](const Tensor &self) {
1783
- return self.square();
1784
- })
1785
- .define_method(
1786
- "_square_",
1787
- *[](Tensor &self) {
1788
- return self.square_();
1789
- })
1790
- .define_method(
1791
- "_squeeze",
1792
- *[](Tensor &self) {
1793
- return self.squeeze();
1794
- })
1795
- .define_method(
1796
- "_squeeze_",
1797
- *[](Tensor &self) {
1798
- return self.squeeze_();
1799
- })
1800
- .define_method(
1801
- "_squeeze__dim",
1802
- *[](Tensor &self, int64_t dim) {
1803
- return self.squeeze_(dim);
1804
- })
1805
- .define_method(
1806
- "_squeeze_dim",
1807
- *[](Tensor &self, int64_t dim) {
1808
- return self.squeeze(dim);
1809
- })
1810
- .define_method(
1811
- "_sspaddmm",
1812
- *[](const Tensor &self, const Tensor &mat1, const Tensor &mat2, Scalar beta, Scalar alpha) {
1813
- return self.sspaddmm(mat1, mat2, beta, alpha);
1814
- })
1815
- .define_method(
1816
- "_std",
1817
- *[](const Tensor &self, bool unbiased) {
1818
- return self.std(unbiased);
1819
- })
1820
- .define_method(
1821
- "_std_dim",
1822
- *[](const Tensor &self, IntArrayRef dim, bool unbiased, bool keepdim) {
1823
- return self.std(dim, unbiased, keepdim);
1824
- })
1825
- .define_method(
1826
- "_stride_int",
1827
- *[](const Tensor &self, int64_t dim) {
1828
- return self.stride(dim);
1829
- })
1830
- .define_method(
1831
- "_sub__scalar",
1832
- *[](Tensor &self, Scalar other, Scalar alpha) {
1833
- return self.sub_(other, alpha);
1834
- })
1835
- .define_method(
1836
- "_sub__tensor",
1837
- *[](Tensor &self, const Tensor &other, Scalar alpha) {
1838
- return self.sub_(other, alpha);
1839
- })
1840
- .define_method(
1841
- "_sub_scalar",
1842
- *[](const Tensor &self, Scalar other, Scalar alpha) {
1843
- return self.sub(other, alpha);
1844
- })
1845
- .define_method(
1846
- "_sub_tensor",
1847
- *[](const Tensor &self, const Tensor &other, Scalar alpha) {
1848
- return self.sub(other, alpha);
1849
- })
1850
- .define_method(
1851
- "_sum",
1852
- *[](const Tensor &self, OptionalScalarType dtype) {
1853
- return self.sum(dtype);
1854
- })
1855
- .define_method(
1856
- "_sum_dim_intlist",
1857
- *[](const Tensor &self, IntArrayRef dim, bool keepdim, OptionalScalarType dtype) {
1858
- return self.sum(dim, keepdim, dtype);
1859
- })
1860
- .define_method(
1861
- "_sum_to_size",
1862
- *[](const Tensor &self, IntArrayRef size) {
1863
- return self.sum_to_size(size);
1864
- })
1865
- .define_method(
1866
- "_svd",
1867
- *[](const Tensor &self, bool some, bool compute_uv) {
1868
- return wrap(self.svd(some, compute_uv));
1869
- })
1870
- .define_method(
1871
- "_symeig",
1872
- *[](const Tensor &self, bool eigenvectors, bool upper) {
1873
- return wrap(self.symeig(eigenvectors, upper));
1874
- })
1875
- .define_method(
1876
- "_t",
1877
- *[](Tensor &self) {
1878
- return self.t();
1879
- })
1880
- .define_method(
1881
- "_t_",
1882
- *[](Tensor &self) {
1883
- return self.t_();
1884
- })
1885
- .define_method(
1886
- "_take",
1887
- *[](const Tensor &self, const Tensor &index) {
1888
- return self.take(index);
1889
- })
1890
- .define_method(
1891
- "_tan",
1892
- *[](const Tensor &self) {
1893
- return self.tan();
1894
- })
1895
- .define_method(
1896
- "_tan_",
1897
- *[](Tensor &self) {
1898
- return self.tan_();
1899
- })
1900
- .define_method(
1901
- "_tanh",
1902
- *[](const Tensor &self) {
1903
- return self.tanh();
1904
- })
1905
- .define_method(
1906
- "_tanh_",
1907
- *[](Tensor &self) {
1908
- return self.tanh_();
1909
- })
1910
- .define_method(
1911
- "_to_dense",
1912
- *[](const Tensor &self) {
1913
- return self.to_dense();
1914
- })
1915
- .define_method(
1916
- "_to_device",
1917
- *[](const Tensor &self, Device device, ScalarType dtype, bool non_blocking, bool copy) {
1918
- return self.to(device, dtype, non_blocking, copy);
1919
- })
1920
- .define_method(
1921
- "_to_dtype",
1922
- *[](const Tensor &self, ScalarType dtype, bool non_blocking, bool copy) {
1923
- return self.to(dtype, non_blocking, copy);
1924
- })
1925
- .define_method(
1926
- "_to_mkldnn",
1927
- *[](const Tensor &self) {
1928
- return self.to_mkldnn();
1929
- })
1930
- .define_method(
1931
- "_to_other",
1932
- *[](const Tensor &self, const Tensor &other, bool non_blocking, bool copy) {
1933
- return self.to(other, non_blocking, copy);
1934
- })
1935
- .define_method(
1936
- "_to_sparse",
1937
- *[](const Tensor &self) {
1938
- return self.to_sparse();
1939
- })
1940
- .define_method(
1941
- "_to_sparse_sparse_dim",
1942
- *[](const Tensor &self, int64_t sparse_dim) {
1943
- return self.to_sparse(sparse_dim);
1944
- })
1945
- .define_method(
1946
- "_topk",
1947
- *[](const Tensor &self, int64_t k, int64_t dim, bool largest, bool sorted) {
1948
- return wrap(self.topk(k, dim, largest, sorted));
1949
- })
1950
- .define_method(
1951
- "_trace",
1952
- *[](const Tensor &self) {
1953
- return self.trace();
1954
- })
1955
- .define_method(
1956
- "_transpose_",
1957
- *[](Tensor &self, int64_t dim0, int64_t dim1) {
1958
- return self.transpose_(dim0, dim1);
1959
- })
1960
- .define_method(
1961
- "_transpose_int",
1962
- *[](Tensor &self, int64_t dim0, int64_t dim1) {
1963
- return self.transpose(dim0, dim1);
1964
- })
1965
- .define_method(
1966
- "_triangular_solve",
1967
- *[](const Tensor &self, const Tensor &A, bool upper, bool transpose, bool unitriangular) {
1968
- return wrap(self.triangular_solve(A, upper, transpose, unitriangular));
1969
- })
1970
- .define_method(
1971
- "_tril",
1972
- *[](const Tensor &self, int64_t diagonal) {
1973
- return self.tril(diagonal);
1974
- })
1975
- .define_method(
1976
- "_tril_",
1977
- *[](Tensor &self, int64_t diagonal) {
1978
- return self.tril_(diagonal);
1979
- })
1980
- .define_method(
1981
- "_triu",
1982
- *[](const Tensor &self, int64_t diagonal) {
1983
- return self.triu(diagonal);
1984
- })
1985
- .define_method(
1986
- "_triu_",
1987
- *[](Tensor &self, int64_t diagonal) {
1988
- return self.triu_(diagonal);
1989
- })
1990
- .define_method(
1991
- "_true_divide__scalar",
1992
- *[](Tensor &self, Scalar other) {
1993
- return self.true_divide_(other);
1994
- })
1995
- .define_method(
1996
- "_true_divide__tensor",
1997
- *[](Tensor &self, const Tensor &other) {
1998
- return self.true_divide_(other);
1999
- })
2000
- .define_method(
2001
- "_true_divide_scalar",
2002
- *[](const Tensor &self, Scalar other) {
2003
- return self.true_divide(other);
2004
- })
2005
- .define_method(
2006
- "_true_divide_tensor",
2007
- *[](const Tensor &self, const Tensor &other) {
2008
- return self.true_divide(other);
2009
- })
2010
- .define_method(
2011
- "_trunc",
2012
- *[](const Tensor &self) {
2013
- return self.trunc();
2014
- })
2015
- .define_method(
2016
- "_trunc_",
2017
- *[](Tensor &self) {
2018
- return self.trunc_();
2019
- })
2020
- .define_method(
2021
- "_type_as",
2022
- *[](const Tensor &self, const Tensor &other) {
2023
- return self.type_as(other);
2024
- })
2025
- .define_method(
2026
- "_unbind_int",
2027
- *[](Tensor &self, int64_t dim) {
2028
- return self.unbind(dim);
2029
- })
2030
- .define_method(
2031
- "_unfold",
2032
- *[](Tensor &self, int64_t dimension, int64_t size, int64_t step) {
2033
- return self.unfold(dimension, size, step);
2034
- })
2035
- .define_method(
2036
- "_uniform_",
2037
- *[](Tensor &self, double from, double to) {
2038
- return self.uniform_(from, to);
2039
- })
2040
- .define_method(
2041
- "_unsqueeze",
2042
- *[](Tensor &self, int64_t dim) {
2043
- return self.unsqueeze(dim);
2044
- })
2045
- .define_method(
2046
- "_unsqueeze_",
2047
- *[](Tensor &self, int64_t dim) {
2048
- return self.unsqueeze_(dim);
2049
- })
2050
- .define_method(
2051
- "_values",
2052
- *[](Tensor &self) {
2053
- return self.values();
2054
- })
2055
- .define_method(
2056
- "_var",
2057
- *[](const Tensor &self, bool unbiased) {
2058
- return self.var(unbiased);
2059
- })
2060
- .define_method(
2061
- "_var_dim",
2062
- *[](const Tensor &self, IntArrayRef dim, bool unbiased, bool keepdim) {
2063
- return self.var(dim, unbiased, keepdim);
2064
- })
2065
- .define_method(
2066
- "_view",
2067
- *[](Tensor &self, IntArrayRef size) {
2068
- return self.view(size);
2069
- })
2070
- .define_method(
2071
- "_view_as",
2072
- *[](const Tensor &self, const Tensor &other) {
2073
- return self.view_as(other);
2074
- })
2075
- .define_method(
2076
- "_where_self",
2077
- *[](const Tensor &condition, const Tensor &self, const Tensor &other) {
2078
- return self.where(condition, other);
2079
- })
2080
- .define_method(
2081
- "_zero_",
2082
- *[](Tensor &self) {
2083
- return self.zero_();
2084
- });
2085
- }