1#pragma once
2
3#include <ATen/ATen.h>
4#include <torch/types.h>
5
6namespace torch {
7namespace special {
8
9/// Computes the natural logarithm of the absolute value of the gamma function
10/// See https://pytorch.org/docs/master/special.html#torch.special.gammaln.
11///
12/// Example:
13/// ```
14/// auto t = torch::randn(128, dtype=kDouble);
15/// torch::special::gammaln(t);
16/// ```
17inline Tensor gammaln(const Tensor& self) {
18 return torch::special_gammaln(self);
19}
20
21inline Tensor& gammaln_out(Tensor& result, const Tensor& self) {
22 return torch::special_gammaln_out(result, self);
23}
24
25/// Computes the regularized lower incomplete gamma function
26/// See https://pytorch.org/docs/master/special.html#torch.special.gammainc.
27///
28/// Example:
29/// ```
30/// auto t = torch::randn(128, dtype=kDouble);
31/// auto s = torch::randn(128, dtype=kDouble);
32/// torch::special::gammainc(s, t);
33/// ```
34inline Tensor gammainc(const Tensor& self, const Tensor& other) {
35 return torch::special_gammainc(self, other);
36}
37
38inline Tensor& gammainc_out(
39 Tensor& result,
40 const Tensor& self,
41 const Tensor& other) {
42 return torch::special_gammainc_out(result, self, other);
43}
44
45/// Computes the regularized upper incomplete gamma function
46/// See https://pytorch.org/docs/master/special.html#torch.special.gammainc.
47///
48/// Example:
49/// ```
50/// auto t = torch::randn(128, dtype=kDouble);
51/// auto s = torch::randn(128, dtype=kDouble);
52/// torch::special::gammaincc(s, t);
53/// ```
54inline Tensor gammaincc(const Tensor& self, const Tensor& other) {
55 return torch::special_gammaincc(self, other);
56}
57
58inline Tensor& gammaincc_out(
59 Tensor& result,
60 const Tensor& self,
61 const Tensor& other) {
62 return torch::special_gammaincc_out(result, self, other);
63}
64
65/// Computes the multivariate log-gamma function with dimension `p`, elementwise
66/// See https://pytorch.org/docs/master/special.html#torch.special.multigammaln.
67///
68/// Example:
69/// ```
70/// auto t = torch::randn(128, dtype=kDouble);
71/// torch::special::multigammaln(t, 1);
72/// ```
73inline Tensor multigammaln(const Tensor& self, int64_t p) {
74 return torch::special_multigammaln(self, p);
75}
76
77inline Tensor& multigammaln_out(Tensor& result, const Tensor& self, int64_t p) {
78 return torch::special_multigammaln_out(result, self, p);
79}
80
81/// Computes the nth derivative of the digamma function on the input.
82/// See https:://pytorch.org/docs/master/special.html#torch.special.polygamma.
83///
84/// Example:
85/// ```
86/// auto t = torch::randn(128, dtype=kDouble);
87/// torch::special::polygamma(2, t);
88/// ```
89inline Tensor polygamma(int64_t n, const Tensor& self) {
90 return torch::special_polygamma(n, self);
91}
92
93inline Tensor& polygamma_out(Tensor& result, int64_t n, const Tensor& self) {
94 return torch::special_polygamma_out(result, n, self);
95}
96
97/// Computes the logarithmic derivative of the gamma function on input
98/// See https://pytorch.org/docs/master/special.html#torch.special.psi
99///
100/// Example:
101/// ```
102/// auto t = torch::randn(128, dtype=kDouble);
103/// torch::special::psi(t);
104/// ```
105inline Tensor psi(const Tensor& self) {
106 return torch::special_psi(self);
107}
108
109inline Tensor& psi_out(Tensor& result, const Tensor& self) {
110 return torch::special_psi_out(result, self);
111}
112
113/// Computes the logarithmic derivative of the gamma function on input
114/// See https://pytorch.org/docs/master/special.html#torch.special.digamma
115///
116/// Example:
117/// ```
118/// auto t = torch::randn(128, dtype=kDouble);
119/// torch::special::digamma(t);
120/// ```
121inline Tensor digamma(const Tensor& self) {
122 return torch::special_digamma(self);
123}
124
125inline Tensor& digamma_out(Tensor& result, const Tensor& self) {
126 return torch::special_digamma_out(result, self);
127}
128
129/// Computes entropy of input, elementwise
130/// See https://pytorch.org/docs/master/special.html#torch.special.entr.
131///
132/// Example:
133/// ```
134/// auto t = torch::randn(128, dtype=kDouble);
135/// torch::special::entr(t);
136/// ```
137inline Tensor entr(const Tensor& self) {
138 return torch::special_entr(self);
139}
140
141inline Tensor& entr_out(Tensor& result, const Tensor& self) {
142 return torch::special_entr_out(result, self);
143}
144
145/// Computes the error function
146/// See https://pytorch.org/docs/master/special.html#torch.special.erf.
147///
148/// Example:
149/// ```
150/// auto t = torch::randn(128, dtype=kDouble);
151/// torch::special::erf(t);
152/// ```
153inline Tensor erf(const Tensor& self) {
154 return torch::special_erf(self);
155}
156
157inline Tensor& erf_out(Tensor& result, const Tensor& self) {
158 return torch::special_erf_out(result, self);
159}
160
161/// Computes the complementary error function
162/// See https://pytorch.org/docs/master/special.html#torch.special.erfc.
163///
164/// Example:
165/// ```
166/// auto t = torch::randn(128, dtype=kDouble);
167/// torch::special::erfc(t);
168/// ```
169inline Tensor erfc(const Tensor& self) {
170 return torch::special_erfc(self);
171}
172
173inline Tensor& erfc_out(Tensor& result, const Tensor& self) {
174 return torch::special_erfc_out(result, self);
175}
176
177/// Computes the scaled complementary error function
178/// See https://pytorch.org/docs/master/special.html#torch.special.erfcx.
179///
180/// Example:
181/// ```
182/// auto t = torch::randn(128, dtype=kDouble);
183/// torch::special::erfcx(t);
184/// ```
185inline Tensor erfcx(const Tensor& self) {
186 return torch::special_erfcx(self);
187}
188
189inline Tensor& erfcx_out(Tensor& result, const Tensor& self) {
190 return torch::special_erfcx_out(result, self);
191}
192
193/// Computes the inverse error function
194/// See https://pytorch.org/docs/master/special.html#torch.special.erfinv.
195///
196/// Example:
197/// ```
198/// auto t = torch::randn(128, dtype=kDouble);
199/// torch::special::erfinv(t);
200/// ```
201inline Tensor erfinv(const Tensor& self) {
202 return torch::special_erfinv(self);
203}
204
205inline Tensor& erfinv_out(Tensor& result, const Tensor& self) {
206 return torch::special_erfinv_out(result, self);
207}
208
209/// Computes the log of summed exponentials of each row of input in the given
210/// dimension dim See
211/// https://pytorch.org/docs/master/special.html#torch.special.logsumexp.
212///
213/// Example:
214/// ```
215/// auto t = torch::randn(3, 3);
216/// torch::special::logsumexp(t, 1);
217/// ```
218inline Tensor logsumexp(const Tensor& self, IntArrayRef dims, bool keepdim) {
219 return torch::special_logsumexp(self, dims, keepdim);
220}
221
222inline Tensor& logsumexp_out(
223 Tensor& result,
224 const Tensor& self,
225 IntArrayRef dims,
226 bool keepdim) {
227 return torch::special_logsumexp_out(result, self, dims, keepdim);
228}
229
230/// Computes the argument, x, for which the area under the Gaussian probability
231/// density function (integrated from minus infinity to x) is equal to input,
232/// elementwise. See
233/// https://pytorch.org/docs/master/special.html#torch.special.ndtri
234///
235/// Example:
236/// ```
237/// auto t = torch::rand(128, dtype=kDouble);
238/// torch::special::ndtri(t);
239/// ```
240inline Tensor ndtri(const Tensor& self) {
241 return torch::special_ndtri(self);
242}
243
244inline Tensor& ndtri_out(Tensor& result, const Tensor& self) {
245 return torch::special_ndtri_out(result, self);
246}
247
248/// Computes the log of area under the standard Gaussian probability density
249/// function, integrated from minus infinity to :attr:`input`, elementwise See
250/// https://pytorch.org/docs/master/special.html#torch.special.log_ndtr
251///
252/// Example:
253/// ```
254/// auto t = torch::randn(128, dtype=kDouble);
255/// torch::special::log_ndtr(t);
256/// ```
257inline Tensor log_ndtr(const Tensor& self) {
258 return torch::special_log_ndtr(self);
259}
260
261inline Tensor& log_ndtr_out(Tensor& result, const Tensor& self) {
262 return torch::special_log_ndtr_out(result, self);
263}
264
265/// Computes the logit of input, elementwise.
266/// See https://pytorch.org/docs/master/special.html#torch.special.logit.
267///
268/// Example:
269/// ```
270/// auto t = torch::randn(128, dtype=kDouble);
271/// torch::special::logit(t);
272/// ```
273inline Tensor logit(const Tensor& self) {
274 return torch::special_logit(self);
275}
276
277inline Tensor& logit_out(Tensor& result, const Tensor& self) {
278 return torch::special_logit_out(result, self);
279}
280
281/// Computes the expit (also known as the logistic sigmoid function) of input,
282/// elementwise See
283/// https://pytorch.org/docs/master/special.html#torch.special.expit.
284///
285/// Example:
286/// ```
287/// auto t = torch::randn(128, dtype=kDouble);
288/// torch::special::expit(t);
289/// ```
290inline Tensor expit(const Tensor& self) {
291 return torch::special_expit(self);
292}
293
294inline Tensor& expit_out(Tensor& result, const Tensor& self) {
295 return torch::special_expit_out(result, self);
296}
297
298/// Computes the base two exponential function of :attr:`input`, elementwise
299/// See https://pytorch.org/docs/master/special.html#torch.special.exp2.
300///
301/// Example:
302/// ```
303/// auto t = torch::randn(128, dtype=kDouble);
304/// torch::special::exp2(t);
305/// ```
306inline Tensor exp2(const Tensor& self) {
307 return torch::special_exp2(self);
308}
309
310inline Tensor& exp2_out(Tensor& result, const Tensor& self) {
311 return torch::special_exp2_out(result, self);
312}
313
314/// Computes the exponential of the elements minus 1, elementwise
315/// See https://pytorch.org/docs/master/special.html#torch.special.expm1.
316///
317/// Example:
318/// ```
319/// auto t = torch::randn(128, dtype=kDouble);
320/// torch::special::expm1(t);
321/// ```
322inline Tensor expm1(const Tensor& self) {
323 return torch::special_expm1(self);
324}
325
326inline Tensor& expm1_out(Tensor& result, const Tensor& self) {
327 return torch::special_expm1_out(result, self);
328}
329
330/// Computes x * log(y) for inputs, elementwise
331/// See https://pytorch.org/docs/master/special.html#torch.special.xlogy.
332///
333/// Example:
334/// ```
335/// auto x = torch::randn(128, dtype=kDouble);
336/// auto y = torch::randn(128, dtype=kDouble);
337/// torch::special::xlogy(x, y);
338/// ```
339inline Tensor xlogy(const Tensor& self, const Tensor& other) {
340 return torch::special_xlogy(self, other);
341}
342
343inline Tensor xlogy(const Scalar& self, const Tensor& other) {
344 return torch::special_xlogy(self, other);
345}
346
347inline Tensor xlogy(const Tensor& self, const Scalar& other) {
348 return torch::special_xlogy(self, other);
349}
350
351inline Tensor& xlogy_out(
352 Tensor& result,
353 const Tensor& self,
354 const Tensor& other) {
355 return torch::special_xlogy_out(result, self, other);
356}
357
358inline Tensor& xlogy_out(
359 Tensor& result,
360 const Scalar& self,
361 const Tensor& other) {
362 return torch::special_xlogy_out(result, self, other);
363}
364
365inline Tensor& xlogy_out(
366 Tensor& result,
367 const Tensor& self,
368 const Scalar& other) {
369 return torch::special_xlogy_out(result, self, other);
370}
371
372/// Computes x * log1p(y) for inputs, elementwise
373/// See https://pytorch.org/docs/master/special.html#torch.special.xlog1py.
374///
375/// Example:
376/// ```
377/// auto x = torch::randn(128, dtype=kDouble);
378/// auto y = torch::randn(128, dtype=kDouble);
379/// torch::special::xlog1py(x, y);
380/// ```
381inline Tensor xlog1py(const Tensor& self, const Tensor& other) {
382 return torch::special_xlog1py(self, other);
383}
384
385inline Tensor xlog1py(const Scalar& self, const Tensor& other) {
386 return torch::special_xlog1py(self, other);
387}
388
389inline Tensor xlog1py(const Tensor& self, const Scalar& other) {
390 return torch::special_xlog1py(self, other);
391}
392
393inline Tensor& xlog1py_out(
394 Tensor& result,
395 const Tensor& self,
396 const Tensor& other) {
397 return torch::special_xlog1py_out(result, self, other);
398}
399
400inline Tensor& xlog1py_out(
401 Tensor& result,
402 const Scalar& self,
403 const Tensor& other) {
404 return torch::special_xlog1py_out(result, self, other);
405}
406
407inline Tensor& xlog1py_out(
408 Tensor& result,
409 const Tensor& self,
410 const Scalar& other) {
411 return torch::special_xlog1py_out(result, self, other);
412}
413
414/// Computes Hurwitz Zeta function for inputs, elementwise
415/// See https://pytorch.org/docs/master/special.html#torch.special.zeta.
416///
417/// Example:
418/// ```
419/// auto x = torch::randn(128, dtype=kDouble);
420/// auto y = torch::randn(128, dtype=kDouble);
421/// torch::special::zeta(x, y);
422/// ```
423inline Tensor zeta(const Tensor& self, const Tensor& other) {
424 return torch::special_zeta(self, other);
425}
426
427inline Tensor zeta(const Scalar& self, const Tensor& other) {
428 return torch::special_zeta(self, other);
429}
430
431inline Tensor zeta(const Tensor& self, const Scalar& other) {
432 return torch::special_zeta(self, other);
433}
434
435inline Tensor& zeta_out(
436 Tensor& result,
437 const Tensor& self,
438 const Tensor& other) {
439 return torch::special_zeta_out(result, self, other);
440}
441
442inline Tensor& zeta_out(
443 Tensor& result,
444 const Scalar& self,
445 const Tensor& other) {
446 return torch::special_zeta_out(result, self, other);
447}
448
449inline Tensor& zeta_out(
450 Tensor& result,
451 const Tensor& self,
452 const Scalar& other) {
453 return torch::special_zeta_out(result, self, other);
454}
455
456/// Computes the zeroth order modified Bessel function of the first kind of
457/// input, elementwise See
458/// https://pytorch.org/docs/master/special.html#torch.special.i0
459///
460/// Example:
461/// ```
462/// auto t = torch::randn(128, dtype=kDouble);
463/// torch::special::i0(t);
464/// ```
465inline Tensor i0(const Tensor& self) {
466 return torch::special_i0(self);
467}
468
469inline Tensor& i0_out(Tensor& result, const Tensor& self) {
470 return torch::special_i0_out(result, self);
471}
472
473/// Computes the area under the standard Gaussian probability density function,
474/// integrated from minus infinity to :attr:`input`, elementwise
475/// See https://pytorch.org/docs/master/special.html#torch.special.ndtr
476///
477/// Example:
478/// ```
479/// auto t = torch::randn(128, dtype=kDouble);
480/// torch::special::ndtr(t);
481/// ```
482inline Tensor ndtr(const Tensor& self) {
483 return torch::special_ndtr(self);
484}
485
486inline Tensor& ndtr_out(Tensor& result, const Tensor& self) {
487 return torch::special_ndtr_out(result, self);
488}
489
490/// Computes the exponentially scaled zeroth order modified Bessel function of
491/// the first kind See
492/// https://pytorch.org/docs/master/special.html#torch.special.i0e.
493///
494/// Example:
495/// ```
496/// auto t = torch::randn(128, dtype=kDouble);
497/// torch::special::i0e(t);
498/// ```
499inline Tensor i0e(const Tensor& self) {
500 return torch::special_i0e(self);
501}
502
503inline Tensor& i0e_out(Tensor& result, const Tensor& self) {
504 return torch::special_i0e_out(result, self);
505}
506
507/// Computes the first order modified Bessel function of the first kind
508/// See https://pytorch.org/docs/master/special.html#torch.special.i1.
509///
510/// Example:
511/// ```
512/// auto t = torch::randn(128, dtype=kDouble);
513/// torch::special::i1(t);
514/// ```
515inline Tensor i1(const Tensor& self) {
516 return torch::special_i1(self);
517}
518
519inline Tensor& i1_out(Tensor& result, const Tensor& self) {
520 return torch::special_i1_out(result, self);
521}
522
523/// Computes the exponentially scaled first order modified Bessel function of
524/// the first kind See
525/// https://pytorch.org/docs/master/special.html#torch.special.i1e.
526///
527/// Example:
528/// ```
529/// auto t = torch::randn(128, dtype=kDouble);
530/// torch::special::i1e(t);
531/// ```
532inline Tensor i1e(const Tensor& self) {
533 return torch::special_i1e(self);
534}
535
536inline Tensor& i1e_out(Tensor& result, const Tensor& self) {
537 return torch::special_i1e_out(result, self);
538}
539
540/// Computes the sinc of input, elementwise
541/// See https://pytorch.org/docs/master/special.html#torch.special.sinc.
542///
543/// Example:
544/// ```
545/// auto t = torch::randn(128, dtype=kDouble);
546/// torch::special::sinc(t);
547/// ```
548inline Tensor sinc(const Tensor& self) {
549 return torch::special_sinc(self);
550}
551
552inline Tensor& sinc_out(Tensor& result, const Tensor& self) {
553 return torch::special_sinc_out(result, self);
554}
555
556/// Rounds the elements of the input
557/// See https://pytorch.org/docs/master/special.html#torch.special.round.
558///
559/// Example:
560/// ```
561/// auto t = torch::randn(128, dtype=kDouble);
562/// torch::special::round(t);
563/// ```
564inline Tensor round(const Tensor& self) {
565 return torch::special_round(self);
566}
567
568inline Tensor& round_out(Tensor& result, const Tensor& self) {
569 return torch::special_round_out(result, self);
570}
571
572/// Computes log(1 + x) of the input, elementwise
573/// See https://pytorch.org/docs/master/special.html#torch.special.log1p.
574///
575/// Example:
576/// ```
577/// auto t = torch::randn(128, dtype=kDouble);
578/// torch::special::log1p(t);
579/// ```
580inline Tensor log1p(const Tensor& self) {
581 return torch::special_log1p(self);
582}
583
584inline Tensor& log1p_out(Tensor& result, const Tensor& self) {
585 return torch::special_log1p_out(result, self);
586}
587
588/// Computes log followed by softmax(x) of the input
589/// See https://pytorch.org/docs/master/special.html#torch.special.log_softmax.
590///
591/// Example:
592/// ```
593/// auto t = torch::randn(128, 128, dtype=kDouble);
594/// torch::special::log_softmax(t, 0);
595/// ```
596inline Tensor log_softmax(
597 const Tensor& self,
598 int64_t dim,
599 c10::optional<ScalarType> dtype) {
600 return torch::special_log_softmax(self, dim, dtype);
601}
602
603/// Computes softmax of the input along a given dimension
604/// See https://pytorch.org/docs/master/special.html#torch.special.softmax.
605///
606/// Example:
607/// ```
608/// auto t = torch::randn(128, 128, dtype=kDouble);
609/// torch::special::softmax(t, 0);
610/// ```
611inline Tensor softmax(
612 const Tensor& self,
613 int64_t dim,
614 c10::optional<ScalarType> dtype) {
615 return torch::special_softmax(self, dim, dtype);
616}
617
618/// Airy function Ai.
619///
620/// See https://pytorch.org/docs/master/special.html#torch.special.airy_ai.
621///
622/// Example:
623///
624/// ```
625/// auto x = torch::randn(128, dtype=kDouble);
626///
627/// torch::special::airy_ai(x);
628/// ```
629inline Tensor airy_ai(const Tensor& x) {
630 return torch::special_airy_ai(x);
631}
632
633inline Tensor& airy_ai_out(Tensor& y, const Tensor& x) {
634 return torch::special_airy_ai_out(y, x);
635}
636
637/// Bessel function of the first kind of order 0.
638///
639/// See https://pytorch.org/docs/master/special.html#torch.special.bessel_j0.
640///
641/// Example:
642///
643/// ```
644/// auto x = torch::randn(128, dtype=kDouble);
645///
646/// torch::special::bessel_j0(x);
647/// ```
648inline Tensor bessel_j0(const Tensor& self) {
649 return torch::special_bessel_j0(self);
650}
651
652inline Tensor& bessel_j0_out(Tensor& result, const Tensor& self) {
653 return torch::special_bessel_j0_out(result, self);
654}
655
656/// Bessel function of the first kind of order 1.
657///
658/// See https://pytorch.org/docs/master/special.html#torch.special.bessel_j1.
659///
660/// Example:
661///
662/// ```
663/// auto x = torch::randn(128, dtype=kDouble);
664///
665/// torch::special::bessel_j1(x);
666/// ```
667inline Tensor bessel_j1(const Tensor& self) {
668 return torch::special_bessel_j1(self);
669}
670
671inline Tensor& bessel_j1_out(Tensor& result, const Tensor& self) {
672 return torch::special_bessel_j1_out(result, self);
673}
674
675/// Bessel function of the second kind of order 0.
676///
677/// See https://pytorch.org/docs/master/special.html#torch.special.bessel_y0.
678///
679/// Example:
680///
681/// ```
682/// auto x = torch::randn(128, dtype=kDouble);
683///
684/// torch::special::bessel_y0(x);
685/// ```
686inline Tensor bessel_y0(const Tensor& self) {
687 return torch::special_bessel_y0(self);
688}
689
690inline Tensor& bessel_y0_out(Tensor& result, const Tensor& self) {
691 return torch::special_bessel_y0_out(result, self);
692}
693
694/// Bessel function of the second kind of order 1.
695///
696/// See https://pytorch.org/docs/master/special.html#torch.special.bessel_y1.
697///
698/// Example:
699///
700/// ```
701/// auto x = torch::randn(128, dtype=kDouble);
702///
703/// torch::special::bessel_y1(x);
704/// ```
705inline Tensor bessel_y1(const Tensor& self) {
706 return torch::special_bessel_y1(self);
707}
708
709inline Tensor& bessel_y1_out(Tensor& result, const Tensor& self) {
710 return torch::special_bessel_y1_out(result, self);
711}
712
713/// Chebyshev polynomial of the first kind.
714///
715/// See
716/// https://pytorch.org/docs/master/special.html#torch.special.chebyshev_polynomial_t.
717///
718/// Example:
719///
720/// ```
721/// auto x = torch::randn(128, dtype=kDouble);
722/// auto n = torch::randn(128, dtype=kDouble);
723///
724/// torch::special::chebyshev_polynomial_t(x, n);
725/// ```
726inline Tensor chebyshev_polynomial_t(const Tensor& x, const Tensor& n) {
727 return torch::special_chebyshev_polynomial_t(x, n);
728}
729
730inline Tensor chebyshev_polynomial_t(const Scalar& x, const Tensor& n) {
731 return torch::special_chebyshev_polynomial_t(x, n);
732}
733
734inline Tensor chebyshev_polynomial_t(const Tensor& x, const Scalar& n) {
735 return torch::special_chebyshev_polynomial_t(x, n);
736}
737
738inline Tensor& chebyshev_polynomial_t_out(
739 Tensor& output,
740 const Tensor& x,
741 const Tensor& n) {
742 return torch::special_chebyshev_polynomial_t_out(output, x, n);
743}
744
745inline Tensor& chebyshev_polynomial_t_out(
746 Tensor& output,
747 const Scalar& x,
748 const Tensor& n) {
749 return torch::special_chebyshev_polynomial_t_out(output, x, n);
750}
751
752inline Tensor& chebyshev_polynomial_t_out(
753 Tensor& output,
754 const Tensor& x,
755 const Scalar& n) {
756 return torch::special_chebyshev_polynomial_t_out(output, x, n);
757}
758
759/// Chebyshev polynomial of the second kind.
760///
761/// See
762/// https://pytorch.org/docs/master/special.html#torch.special.chebyshev_polynomial_u.
763///
764/// Example:
765///
766/// ```
767/// auto x = torch::randn(128, dtype=kDouble);
768/// auto n = torch::randn(128, dtype=kDouble);
769///
770/// torch::special::chebyshev_polynomial_u(x, n);
771/// ```
772inline Tensor chebyshev_polynomial_u(const Tensor& x, const Tensor& n) {
773 return torch::special_chebyshev_polynomial_u(x, n);
774}
775
776inline Tensor chebyshev_polynomial_u(const Scalar& x, const Tensor& n) {
777 return torch::special_chebyshev_polynomial_u(x, n);
778}
779
780inline Tensor chebyshev_polynomial_u(const Tensor& x, const Scalar& n) {
781 return torch::special_chebyshev_polynomial_u(x, n);
782}
783
784inline Tensor& chebyshev_polynomial_u_out(
785 Tensor& output,
786 const Tensor& x,
787 const Tensor& n) {
788 return torch::special_chebyshev_polynomial_u_out(output, x, n);
789}
790
791inline Tensor& chebyshev_polynomial_u_out(
792 Tensor& output,
793 const Scalar& x,
794 const Tensor& n) {
795 return torch::special_chebyshev_polynomial_u_out(output, x, n);
796}
797
798inline Tensor& chebyshev_polynomial_u_out(
799 Tensor& output,
800 const Tensor& x,
801 const Scalar& n) {
802 return torch::special_chebyshev_polynomial_u_out(output, x, n);
803}
804
805/// Chebyshev polynomial of the third kind.
806///
807/// See
808/// https://pytorch.org/docs/master/special.html#torch.special.chebyshev_polynomial_v.
809///
810/// Example:
811///
812/// ```
813/// auto x = torch::randn(128, dtype=kDouble);
814/// auto n = torch::randn(128, dtype=kDouble);
815///
816/// torch::special::chebyshev_polynomial_v(x, n);
817/// ```
818inline Tensor chebyshev_polynomial_v(const Tensor& x, const Tensor& n) {
819 return torch::special_chebyshev_polynomial_v(x, n);
820}
821
822inline Tensor chebyshev_polynomial_v(const Scalar& x, const Tensor& n) {
823 return torch::special_chebyshev_polynomial_v(x, n);
824}
825
826inline Tensor chebyshev_polynomial_v(const Tensor& x, const Scalar& n) {
827 return torch::special_chebyshev_polynomial_v(x, n);
828}
829
830inline Tensor& chebyshev_polynomial_v_out(
831 Tensor& output,
832 const Tensor& x,
833 const Tensor& n) {
834 return torch::special_chebyshev_polynomial_v_out(output, x, n);
835}
836
837inline Tensor& chebyshev_polynomial_v_out(
838 Tensor& output,
839 const Scalar& x,
840 const Tensor& n) {
841 return torch::special_chebyshev_polynomial_v_out(output, x, n);
842}
843
844inline Tensor& chebyshev_polynomial_v_out(
845 Tensor& output,
846 const Tensor& x,
847 const Scalar& n) {
848 return torch::special_chebyshev_polynomial_v_out(output, x, n);
849}
850
851/// Chebyshev polynomial of the fourth kind.
852///
853/// See
854/// https://pytorch.org/docs/master/special.html#torch.special.chebyshev_polynomial_w.
855///
856/// Example:
857///
858/// ```
859/// auto x = torch::randn(128, dtype=kDouble);
860/// auto n = torch::randn(128, dtype=kDouble);
861///
862/// torch::special::chebyshev_polynomial_w(x, n);
863/// ```
864inline Tensor chebyshev_polynomial_w(const Tensor& x, const Tensor& n) {
865 return torch::special_chebyshev_polynomial_w(x, n);
866}
867
868inline Tensor chebyshev_polynomial_w(const Scalar& x, const Tensor& n) {
869 return torch::special_chebyshev_polynomial_w(x, n);
870}
871
872inline Tensor chebyshev_polynomial_w(const Tensor& x, const Scalar& n) {
873 return torch::special_chebyshev_polynomial_w(x, n);
874}
875
876inline Tensor& chebyshev_polynomial_w_out(
877 Tensor& output,
878 const Tensor& x,
879 const Tensor& n) {
880 return torch::special_chebyshev_polynomial_w_out(output, x, n);
881}
882
883inline Tensor& chebyshev_polynomial_w_out(
884 Tensor& output,
885 const Scalar& x,
886 const Tensor& n) {
887 return torch::special_chebyshev_polynomial_w_out(output, x, n);
888}
889
890inline Tensor& chebyshev_polynomial_w_out(
891 Tensor& output,
892 const Tensor& x,
893 const Scalar& n) {
894 return torch::special_chebyshev_polynomial_w_out(output, x, n);
895}
896
897/// Physicist’s Hermite polynomial.
898///
899/// See
900/// https://pytorch.org/docs/master/special.html#torch.special.hermite_polynomial_h.
901///
902/// Example:
903///
904/// ```
905/// auto x = torch::randn(128, dtype=kDouble);
906/// auto n = torch::randn(128, dtype=kDouble);
907///
908/// torch::special::hermite_polynomial_h(x, n);
909/// ```
910inline Tensor hermite_polynomial_h(const Tensor& x, const Tensor& n) {
911 return torch::special_hermite_polynomial_h(x, n);
912}
913
914inline Tensor hermite_polynomial_h(const Scalar& x, const Tensor& n) {
915 return torch::special_hermite_polynomial_h(x, n);
916}
917
918inline Tensor hermite_polynomial_h(const Tensor& x, const Scalar& n) {
919 return torch::special_hermite_polynomial_h(x, n);
920}
921
922inline Tensor& hermite_polynomial_h_out(
923 Tensor& output,
924 const Tensor& x,
925 const Tensor& n) {
926 return torch::special_hermite_polynomial_h_out(output, x, n);
927}
928
929inline Tensor& hermite_polynomial_h_out(
930 Tensor& output,
931 const Scalar& x,
932 const Tensor& n) {
933 return torch::special_hermite_polynomial_h_out(output, x, n);
934}
935
936inline Tensor& hermite_polynomial_h_out(
937 Tensor& output,
938 const Tensor& x,
939 const Scalar& n) {
940 return torch::special_hermite_polynomial_h_out(output, x, n);
941}
942
943/// Probabilist’s Hermite polynomial.
944///
945/// See
946/// https://pytorch.org/docs/master/special.html#torch.special.hermite_polynomial_he.
947///
948/// Example:
949///
950/// ```
951/// auto x = torch::randn(128, dtype=kDouble);
952/// auto n = torch::randn(128, dtype=kDouble);
953///
954/// torch::special::hermite_polynomial_he(x, n);
955/// ```
956inline Tensor hermite_polynomial_he(const Tensor& x, const Tensor& n) {
957 return torch::special_hermite_polynomial_he(x, n);
958}
959
960inline Tensor hermite_polynomial_he(const Scalar& x, const Tensor& n) {
961 return torch::special_hermite_polynomial_he(x, n);
962}
963
964inline Tensor hermite_polynomial_he(const Tensor& x, const Scalar& n) {
965 return torch::special_hermite_polynomial_he(x, n);
966}
967
968inline Tensor& hermite_polynomial_he_out(
969 Tensor& output,
970 const Tensor& x,
971 const Tensor& n) {
972 return torch::special_hermite_polynomial_he_out(output, x, n);
973}
974
975inline Tensor& hermite_polynomial_he_out(
976 Tensor& output,
977 const Scalar& x,
978 const Tensor& n) {
979 return torch::special_hermite_polynomial_he_out(output, x, n);
980}
981
982inline Tensor& hermite_polynomial_he_out(
983 Tensor& output,
984 const Tensor& x,
985 const Scalar& n) {
986 return torch::special_hermite_polynomial_he_out(output, x, n);
987}
988
989/// Laguerre polynomial.
990///
991/// See
992/// https://pytorch.org/docs/master/special.html#torch.special.laguerre_polynomial_l.
993///
994/// Example:
995///
996/// ```
997/// auto x = torch::randn(128, dtype=kDouble);
998/// auto n = torch::randn(128, dtype=kDouble);
999///
1000/// torch::special::laguerre_polynomial_l(x, n);
1001/// ```
1002inline Tensor laguerre_polynomial_l(const Tensor& x, const Tensor& n) {
1003 return torch::special_laguerre_polynomial_l(x, n);
1004}
1005
1006inline Tensor laguerre_polynomial_l(const Scalar& x, const Tensor& n) {
1007 return torch::special_laguerre_polynomial_l(x, n);
1008}
1009
1010inline Tensor laguerre_polynomial_l(const Tensor& x, const Scalar& n) {
1011 return torch::special_laguerre_polynomial_l(x, n);
1012}
1013
1014inline Tensor& laguerre_polynomial_l_out(
1015 Tensor& output,
1016 const Tensor& x,
1017 const Tensor& n) {
1018 return torch::special_laguerre_polynomial_l_out(output, x, n);
1019}
1020
1021inline Tensor& laguerre_polynomial_l_out(
1022 Tensor& output,
1023 const Scalar& x,
1024 const Tensor& n) {
1025 return torch::special_laguerre_polynomial_l_out(output, x, n);
1026}
1027
1028inline Tensor& laguerre_polynomial_l_out(
1029 Tensor& output,
1030 const Tensor& x,
1031 const Scalar& n) {
1032 return torch::special_laguerre_polynomial_l_out(output, x, n);
1033}
1034
1035/// Legendre polynomial.
1036///
1037/// See
1038/// https://pytorch.org/docs/master/special.html#torch.special.legendre_polynomial_p.
1039///
1040/// Example:
1041///
1042/// ```
1043/// auto x = torch::randn(128, dtype=kDouble);
1044/// auto n = torch::randn(128, dtype=kDouble);
1045///
1046/// torch::special::legendre_polynomial_p(x, n);
1047/// ```
1048inline Tensor legendre_polynomial_p(const Tensor& x, const Tensor& n) {
1049 return torch::special_legendre_polynomial_p(x, n);
1050}
1051
1052inline Tensor legendre_polynomial_p(const Scalar& x, const Tensor& n) {
1053 return torch::special_legendre_polynomial_p(x, n);
1054}
1055
1056inline Tensor legendre_polynomial_p(const Tensor& x, const Scalar& n) {
1057 return torch::special_legendre_polynomial_p(x, n);
1058}
1059
1060inline Tensor& legendre_polynomial_p_out(
1061 Tensor& output,
1062 const Tensor& x,
1063 const Tensor& n) {
1064 return torch::special_legendre_polynomial_p_out(output, x, n);
1065}
1066
1067inline Tensor& legendre_polynomial_p_out(
1068 Tensor& output,
1069 const Scalar& x,
1070 const Tensor& n) {
1071 return torch::special_legendre_polynomial_p_out(output, x, n);
1072}
1073
1074inline Tensor& legendre_polynomial_p_out(
1075 Tensor& output,
1076 const Tensor& x,
1077 const Scalar& n) {
1078 return torch::special_legendre_polynomial_p_out(output, x, n);
1079}
1080
1081/// Modified Bessel function of the first kind of order 0.
1082///
1083/// See
1084/// https://pytorch.org/docs/master/special.html#torch.special.modified_bessel_i0.
1085///
1086/// Example:
1087///
1088/// ```
1089/// auto x = torch::randn(128, dtype=kDouble);
1090///
1091/// torch::special::modified_bessel_i0(x);
1092/// ```
1093inline Tensor modified_bessel_i0(const Tensor& self) {
1094 return torch::special_modified_bessel_i0(self);
1095}
1096
1097inline Tensor& modified_bessel_i0_out(Tensor& result, const Tensor& self) {
1098 return torch::special_modified_bessel_i0_out(result, self);
1099}
1100
1101/// Modified Bessel function of the first kind of order 1.
1102///
1103/// See
1104/// https://pytorch.org/docs/master/special.html#torch.special.modified_bessel_i1.
1105///
1106/// Example:
1107///
1108/// ```
1109/// auto x = torch::randn(128, dtype=kDouble);
1110///
1111/// torch::special::modified_bessel_i1(x);
1112/// ```
1113inline Tensor modified_bessel_i1(const Tensor& self) {
1114 return torch::special_modified_bessel_i1(self);
1115}
1116
1117inline Tensor& modified_bessel_i1_out(Tensor& result, const Tensor& self) {
1118 return torch::special_modified_bessel_i1_out(result, self);
1119}
1120
1121/// Modified Bessel function of the second kind of order 0.
1122///
1123/// See
1124/// https://pytorch.org/docs/master/special.html#torch.special.modified_bessel_k0.
1125///
1126/// Example:
1127///
1128/// ```
1129/// auto x = torch::randn(128, dtype=kDouble);
1130///
1131/// torch::special::modified_bessel_k0(x);
1132/// ```
1133inline Tensor modified_bessel_k0(const Tensor& self) {
1134 return torch::special_modified_bessel_k0(self);
1135}
1136
1137inline Tensor& modified_bessel_k0_out(Tensor& result, const Tensor& self) {
1138 return torch::special_modified_bessel_k0_out(result, self);
1139}
1140
1141/// Modified Bessel function of the second kind of order 1.
1142///
1143/// See
1144/// https://pytorch.org/docs/master/special.html#torch.special.modified_bessel_k1.
1145///
1146/// Example:
1147///
1148/// ```
1149/// auto x = torch::randn(128, dtype=kDouble);
1150///
1151/// torch::special::modified_bessel_k1(x);
1152/// ```
1153inline Tensor modified_bessel_k1(const Tensor& self) {
1154 return torch::special_modified_bessel_k1(self);
1155}
1156
1157inline Tensor& modified_bessel_k1_out(Tensor& result, const Tensor& self) {
1158 return torch::special_modified_bessel_k1_out(result, self);
1159}
1160
1161/// Scaled modified Bessel function of the second kind of order 0.
1162///
1163/// See
1164/// https://pytorch.org/docs/master/special.html#torch.special.scaled_modified_bessel_k0.
1165///
1166/// Example:
1167///
1168/// ```
1169/// auto x = torch::randn(128, dtype=kDouble);
1170///
1171/// torch::special::scaled_modified_bessel_k0(x);
1172/// ```
1173inline Tensor scaled_modified_bessel_k0(const Tensor& x) {
1174 return torch::special_scaled_modified_bessel_k0(x);
1175}
1176
1177inline Tensor& scaled_modified_bessel_k0_out(Tensor& y, const Tensor& x) {
1178 return torch::special_scaled_modified_bessel_k0_out(y, x);
1179}
1180
1181/// Scaled modified Bessel function of the second kind of order 1.
1182///
1183/// See
1184/// https://pytorch.org/docs/master/special.html#torch.special.scaled_modified_bessel_k1.
1185///
1186/// Example:
1187///
1188/// ```
1189/// auto x = torch::randn(128, dtype=kDouble);
1190///
1191/// torch::special::scaled_modified_bessel_k1(x);
1192/// ```
1193inline Tensor scaled_modified_bessel_k1(const Tensor& x) {
1194 return torch::special_scaled_modified_bessel_k1(x);
1195}
1196
1197inline Tensor& scaled_modified_bessel_k1_out(Tensor& y, const Tensor& x) {
1198 return torch::special_scaled_modified_bessel_k1_out(y, x);
1199}
1200
1201/// Shifted Chebyshev polynomial of the first kind.
1202///
1203/// See
1204/// https://pytorch.org/docs/master/special.html#torch.special.shifted_chebyshev_polynomial_t.
1205///
1206/// Example:
1207///
1208/// ```
1209/// auto x = torch::randn(128, dtype=kDouble);
1210/// auto n = torch::randn(128, dtype=kDouble);
1211///
1212/// torch::special::shifted_chebyshev_polynomial_t(x, n);
1213/// ```
1214inline Tensor shifted_chebyshev_polynomial_t(const Tensor& x, const Tensor& n) {
1215 return torch::special_shifted_chebyshev_polynomial_t(x, n);
1216}
1217
1218inline Tensor shifted_chebyshev_polynomial_t(const Scalar& x, const Tensor& n) {
1219 return torch::special_shifted_chebyshev_polynomial_t(x, n);
1220}
1221
1222inline Tensor shifted_chebyshev_polynomial_t(const Tensor& x, const Scalar& n) {
1223 return torch::special_shifted_chebyshev_polynomial_t(x, n);
1224}
1225
1226inline Tensor& shifted_chebyshev_polynomial_t_out(
1227 Tensor& output,
1228 const Tensor& x,
1229 const Tensor& n) {
1230 return torch::special_shifted_chebyshev_polynomial_t_out(output, x, n);
1231}
1232
1233inline Tensor& shifted_chebyshev_polynomial_t_out(
1234 Tensor& output,
1235 const Scalar& x,
1236 const Tensor& n) {
1237 return torch::special_shifted_chebyshev_polynomial_t_out(output, x, n);
1238}
1239
1240inline Tensor& shifted_chebyshev_polynomial_t_out(
1241 Tensor& output,
1242 const Tensor& x,
1243 const Scalar& n) {
1244 return torch::special_shifted_chebyshev_polynomial_t_out(output, x, n);
1245}
1246
1247/// Shifted Chebyshev polynomial of the second kind.
1248///
1249/// See
1250/// https://pytorch.org/docs/master/special.html#torch.special.shifted_chebyshev_polynomial_u.
1251///
1252/// Example:
1253///
1254/// ```
1255/// auto x = torch::randn(128, dtype=kDouble);
1256/// auto n = torch::randn(128, dtype=kDouble);
1257///
1258/// torch::special::shifted_chebyshev_polynomial_u(x, n);
1259/// ```
1260inline Tensor shifted_chebyshev_polynomial_u(const Tensor& x, const Tensor& n) {
1261 return torch::special_shifted_chebyshev_polynomial_u(x, n);
1262}
1263
1264inline Tensor shifted_chebyshev_polynomial_u(const Scalar& x, const Tensor& n) {
1265 return torch::special_shifted_chebyshev_polynomial_u(x, n);
1266}
1267
1268inline Tensor shifted_chebyshev_polynomial_u(const Tensor& x, const Scalar& n) {
1269 return torch::special_shifted_chebyshev_polynomial_u(x, n);
1270}
1271
1272inline Tensor& shifted_chebyshev_polynomial_u_out(
1273 Tensor& output,
1274 const Tensor& x,
1275 const Tensor& n) {
1276 return torch::special_shifted_chebyshev_polynomial_u_out(output, x, n);
1277}
1278
1279inline Tensor& shifted_chebyshev_polynomial_u_out(
1280 Tensor& output,
1281 const Scalar& x,
1282 const Tensor& n) {
1283 return torch::special_shifted_chebyshev_polynomial_u_out(output, x, n);
1284}
1285
1286inline Tensor& shifted_chebyshev_polynomial_u_out(
1287 Tensor& output,
1288 const Tensor& x,
1289 const Scalar& n) {
1290 return torch::special_shifted_chebyshev_polynomial_u_out(output, x, n);
1291}
1292
1293/// Shifted Chebyshev polynomial of the third kind.
1294///
1295/// See
1296/// https://pytorch.org/docs/master/special.html#torch.special.shifted_chebyshev_polynomial_v.
1297///
1298/// Example:
1299///
1300/// ```
1301/// auto x = torch::randn(128, dtype=kDouble);
1302/// auto n = torch::randn(128, dtype=kDouble);
1303///
1304/// torch::special::shifted_chebyshev_polynomial_v(x, n);
1305/// ```
1306inline Tensor shifted_chebyshev_polynomial_v(const Tensor& x, const Tensor& n) {
1307 return torch::special_shifted_chebyshev_polynomial_v(x, n);
1308}
1309
1310inline Tensor shifted_chebyshev_polynomial_v(const Scalar& x, const Tensor& n) {
1311 return torch::special_shifted_chebyshev_polynomial_v(x, n);
1312}
1313
1314inline Tensor shifted_chebyshev_polynomial_v(const Tensor& x, const Scalar& n) {
1315 return torch::special_shifted_chebyshev_polynomial_v(x, n);
1316}
1317
1318inline Tensor& shifted_chebyshev_polynomial_v_out(
1319 Tensor& output,
1320 const Tensor& x,
1321 const Tensor& n) {
1322 return torch::special_shifted_chebyshev_polynomial_v_out(output, x, n);
1323}
1324
1325inline Tensor& shifted_chebyshev_polynomial_v_out(
1326 Tensor& output,
1327 const Scalar& x,
1328 const Tensor& n) {
1329 return torch::special_shifted_chebyshev_polynomial_v_out(output, x, n);
1330}
1331
1332inline Tensor& shifted_chebyshev_polynomial_v_out(
1333 Tensor& output,
1334 const Tensor& x,
1335 const Scalar& n) {
1336 return torch::special_shifted_chebyshev_polynomial_v_out(output, x, n);
1337}
1338
1339/// Shifted Chebyshev polynomial of the fourth kind.
1340///
1341/// See
1342/// https://pytorch.org/docs/master/special.html#torch.special.shifted_chebyshev_polynomial_w.
1343///
1344/// Example:
1345///
1346/// ```
1347/// auto x = torch::randn(128, dtype=kDouble);
1348/// auto n = torch::randn(128, dtype=kDouble);
1349///
1350/// torch::special::shifted_chebyshev_polynomial_w(x, n);
1351/// ```
1352inline Tensor shifted_chebyshev_polynomial_w(const Tensor& x, const Tensor& n) {
1353 return torch::special_shifted_chebyshev_polynomial_w(x, n);
1354}
1355
1356inline Tensor shifted_chebyshev_polynomial_w(const Scalar& x, const Tensor& n) {
1357 return torch::special_shifted_chebyshev_polynomial_w(x, n);
1358}
1359
1360inline Tensor shifted_chebyshev_polynomial_w(const Tensor& x, const Scalar& n) {
1361 return torch::special_shifted_chebyshev_polynomial_w(x, n);
1362}
1363
1364inline Tensor& shifted_chebyshev_polynomial_w_out(
1365 Tensor& output,
1366 const Tensor& x,
1367 const Tensor& n) {
1368 return torch::special_shifted_chebyshev_polynomial_w_out(output, x, n);
1369}
1370
1371inline Tensor& shifted_chebyshev_polynomial_w_out(
1372 Tensor& output,
1373 const Scalar& x,
1374 const Tensor& n) {
1375 return torch::special_shifted_chebyshev_polynomial_w_out(output, x, n);
1376}
1377
1378inline Tensor& shifted_chebyshev_polynomial_w_out(
1379 Tensor& output,
1380 const Tensor& x,
1381 const Scalar& n) {
1382 return torch::special_shifted_chebyshev_polynomial_w_out(output, x, n);
1383}
1384
1385/// Spherical Bessel function of the first kind of order 0.
1386///
1387/// See
1388/// https://pytorch.org/docs/master/special.html#torch.special.spherical_bessel_j0.
1389///
1390/// Example:
1391///
1392/// ```
1393/// auto x = torch::randn(128, dtype=kDouble);
1394///
1395/// torch::special::spherical_bessel_j0(x);
1396/// ```
1397inline Tensor spherical_bessel_j0(const Tensor& x) {
1398 return torch::special_spherical_bessel_j0(x);
1399}
1400
1401inline Tensor& spherical_bessel_j0_out(Tensor& y, const Tensor& x) {
1402 return torch::special_spherical_bessel_j0_out(y, x);
1403}
1404} // namespace special
1405} // namespace torch
1406