Pointwise ops

Unreleased native NuTorch shell reference. Generated by scripts/gen-ops-reference.ts; every op also documents itself with torch <op> --help. Tensor operands are native values, not strings.

add

a + alpha*b (broadcasting; —alpha default 1)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch add <t1> <t2> [--alpha <Scalar>]

sub

a - alpha*b (broadcasting; —alpha default 1)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sub <t1> <t2> [--alpha <Scalar>]

sin

elementwise sine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sin <t1>

pow

elementwise power (scalar or tensor exponent)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch pow <t1> <exponent>

clamp

clamp into [min, max] (scalar or tensor bounds; one required)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch clamp <t1> [--min <TensorOrScalar>] [--max <TensorOrScalar>]

abs

elementwise absolute value

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch abs <t1>

acos

elementwise arccosine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch acos <t1>

acosh

elementwise inverse hyperbolic cosine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch acosh <t1>

asin

elementwise arcsine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch asin <t1>

asinh

elementwise inverse hyperbolic sine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch asinh <t1>

atan

elementwise arctangent

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch atan <t1>

atanh

elementwise inverse hyperbolic tangent

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch atanh <t1>

ceil

elementwise ceiling

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch ceil <t1>

cos

elementwise cosine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch cos <t1>

cosh

elementwise hyperbolic cosine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch cosh <t1>

deg2rad

degrees to radians

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch deg2rad <t1>

digamma

elementwise digamma

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch digamma <t1>

erf

elementwise error function

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch erf <t1>

erfc

elementwise complementary error function

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch erfc <t1>

exp

elementwise e^x

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch exp <t1>

exp2

elementwise 2^x

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch exp2 <t1>

expm1

elementwise e^x - 1

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch expm1 <t1>

floor

elementwise floor

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch floor <t1>

frac

elementwise fractional part

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch frac <t1>

i0

elementwise modified Bessel function I0

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch i0 <t1>

lgamma

elementwise log-gamma

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch lgamma <t1>

log

elementwise natural log

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch log <t1>

log10

elementwise log base 10

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch log10 <t1>

log1p

elementwise log(1+x)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch log1p <t1>

log2

elementwise log base 2

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch log2 <t1>

logit

elementwise logit (inverse sigmoid)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logit <t1>

neg

elementwise negation

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch neg <t1>

rad2deg

radians to degrees

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch rad2deg <t1>

reciprocal

elementwise 1/x

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch reciprocal <t1>

relu

elementwise max(x, 0)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch relu <t1>

round

elementwise round to nearest

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch round <t1>

rsqrt

elementwise 1/sqrt(x)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch rsqrt <t1>

sgn

elementwise sign (complex-aware)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sgn <t1>

sigmoid

elementwise sigmoid

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sigmoid <t1>

sign

elementwise sign

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sign <t1>

sinc

elementwise normalized sinc

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sinc <t1>

sinh

elementwise hyperbolic sine

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sinh <t1>

sqrt

elementwise square root

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch sqrt <t1>

square

elementwise x^2

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch square <t1>

tan

elementwise tangent

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch tan <t1>

tanh

elementwise hyperbolic tangent

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch tanh <t1>

trunc

elementwise truncation toward zero

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch trunc <t1>

softmax

softmax along —dim (float32)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch softmax <t1> [--dim <Int>]

log_softmax

log-softmax along —dim (float32)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch log_softmax <t1> [--dim <Int>]

nan_to_num

replace NaN/inf (—nan/—posinf/—neginf)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch nan_to_num <t1> [--nan <Float>] [--posinf <Float>] [--neginf <Float>]

mul

elementwise product (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch mul <t1> <t2>

div

elementwise true division (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch div <t1> <t2>

maximum

elementwise maximum (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch maximum <t1> <t2>

minimum

elementwise minimum (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch minimum <t1> <t2>

atan2

elementwise atan2(a, b) (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch atan2 <t1> <t2>

fmod

elementwise C-style remainder (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch fmod <t1> <t2>

remainder

elementwise Python-style remainder (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch remainder <t1> <t2>

floor_divide

elementwise floor division (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch floor_divide <t1> <t2>

hypot

elementwise hypotenuse (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch hypot <t1> <t2>

copysign

magnitude of a, sign of b (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch copysign <t1> <t2>

xlogy

elementwise x*log(y) (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch xlogy <t1> <t2>

logaddexp

elementwise log(e^a + e^b) (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch logaddexp <t1> <t2>

lerp

a + weight*(b - a) (scalar or tensor weight)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch lerp <t1> <t2> <weight>

addcmul

a + value * b * c

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch addcmul <t1> <t2> <t3> [--value <Scalar>]

addcdiv

a + value * b / c

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch addcdiv <t1> <t2> <t3> [--value <Scalar>]

bitwise_and

bitwise AND of int tensors (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_and <t1> <t2>

bitwise_or

bitwise OR of int tensors (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_or <t1> <t2>

bitwise_xor

bitwise XOR of int tensors (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_xor <t1> <t2>

bitwise_not

bitwise NOT of an int tensor

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_not <t1>

bitwise_left_shift

left shift of int tensors (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_left_shift <t1> <t2>

bitwise_right_shift

right shift of int tensors (broadcasting)

Signature (placeholders describe arguments; this is not a runnable example):

use torch
torch bitwise_right_shift <t1> <t2>