Pointwise ops
Generated from the binaries by scripts/gen-ops-reference.ts — do not edit by
hand. Every op also documents itself: torch <op> --help.
add
a + alpha*b (broadcasting; —alpha default 1)
torch add <t1> <t2> [--alpha <Scalar>]torch add <t1> <t2> [--alpha <Scalar>]sub
a - alpha*b (broadcasting; —alpha default 1)
torch sub <t1> <t2> [--alpha <Scalar>]torch sub <t1> <t2> [--alpha <Scalar>]sin
elementwise sine
torch sin <t1>torch sin <t1>pow
elementwise power (scalar or tensor exponent)
torch pow <t1> <exponent>torch pow <t1> <exponent>clamp
clamp into [min, max] (scalar or tensor bounds; one required)
torch clamp <t1> [--min <HandleOrScalar>] [--max <HandleOrScalar>]torch clamp <t1> [--min <HandleOrScalar>] [--max <HandleOrScalar>]abs
elementwise absolute value
torch abs <t1>torch abs <t1>acos
elementwise arccosine
torch acos <t1>torch acos <t1>acosh
elementwise inverse hyperbolic cosine
torch acosh <t1>torch acosh <t1>asin
elementwise arcsine
torch asin <t1>torch asin <t1>asinh
elementwise inverse hyperbolic sine
torch asinh <t1>torch asinh <t1>atan
elementwise arctangent
torch atan <t1>torch atan <t1>atanh
elementwise inverse hyperbolic tangent
torch atanh <t1>torch atanh <t1>ceil
elementwise ceiling
torch ceil <t1>torch ceil <t1>cos
elementwise cosine
torch cos <t1>torch cos <t1>cosh
elementwise hyperbolic cosine
torch cosh <t1>torch cosh <t1>deg2rad
degrees to radians
torch deg2rad <t1>torch deg2rad <t1>digamma
elementwise digamma
torch digamma <t1>torch digamma <t1>erf
elementwise error function
torch erf <t1>torch erf <t1>erfc
elementwise complementary error function
torch erfc <t1>torch erfc <t1>exp
elementwise e^x
torch exp <t1>torch exp <t1>exp2
elementwise 2^x
torch exp2 <t1>torch exp2 <t1>expm1
elementwise e^x - 1
torch expm1 <t1>torch expm1 <t1>floor
elementwise floor
torch floor <t1>torch floor <t1>frac
elementwise fractional part
torch frac <t1>torch frac <t1>i0
elementwise modified Bessel function I0
torch i0 <t1>torch i0 <t1>lgamma
elementwise log-gamma
torch lgamma <t1>torch lgamma <t1>log
elementwise natural log
torch log <t1>torch log <t1>log10
elementwise log base 10
torch log10 <t1>torch log10 <t1>log1p
elementwise log(1+x)
torch log1p <t1>torch log1p <t1>log2
elementwise log base 2
torch log2 <t1>torch log2 <t1>logit
elementwise logit (inverse sigmoid)
torch logit <t1>torch logit <t1>neg
elementwise negation
torch neg <t1>torch neg <t1>rad2deg
radians to degrees
torch rad2deg <t1>torch rad2deg <t1>reciprocal
elementwise 1/x
torch reciprocal <t1>torch reciprocal <t1>relu
elementwise max(x, 0)
torch relu <t1>torch relu <t1>round
elementwise round to nearest
torch round <t1>torch round <t1>rsqrt
elementwise 1/sqrt(x)
torch rsqrt <t1>torch rsqrt <t1>sgn
elementwise sign (complex-aware)
torch sgn <t1>torch sgn <t1>sigmoid
elementwise sigmoid
torch sigmoid <t1>torch sigmoid <t1>sign
elementwise sign
torch sign <t1>torch sign <t1>sinc
elementwise normalized sinc
torch sinc <t1>torch sinc <t1>sinh
elementwise hyperbolic sine
torch sinh <t1>torch sinh <t1>sqrt
elementwise square root
torch sqrt <t1>torch sqrt <t1>square
elementwise x^2
torch square <t1>torch square <t1>tan
elementwise tangent
torch tan <t1>torch tan <t1>tanh
elementwise hyperbolic tangent
torch tanh <t1>torch tanh <t1>trunc
elementwise truncation toward zero
torch trunc <t1>torch trunc <t1>softmax
softmax along —dim (float32)
torch softmax <t1> [--dim <Int>]torch softmax <t1> [--dim <Int>]log_softmax
log-softmax along —dim (float32)
torch log_softmax <t1> [--dim <Int>]torch log_softmax <t1> [--dim <Int>]nan_to_num
replace NaN/inf (—nan/—posinf/—neginf)
torch nan_to_num <t1> [--nan <Float>] [--posinf <Float>] [--neginf <Float>]torch nan_to_num <t1> [--nan <Float>] [--posinf <Float>] [--neginf <Float>]mul
elementwise product (broadcasting)
torch mul <t1> <t2>torch mul <t1> <t2>div
elementwise true division (broadcasting)
torch div <t1> <t2>torch div <t1> <t2>maximum
elementwise maximum (broadcasting)
torch maximum <t1> <t2>torch maximum <t1> <t2>minimum
elementwise minimum (broadcasting)
torch minimum <t1> <t2>torch minimum <t1> <t2>atan2
elementwise atan2(a, b) (broadcasting)
torch atan2 <t1> <t2>torch atan2 <t1> <t2>fmod
elementwise C-style remainder (broadcasting)
torch fmod <t1> <t2>torch fmod <t1> <t2>remainder
elementwise Python-style remainder (broadcasting)
torch remainder <t1> <t2>torch remainder <t1> <t2>floor_divide
elementwise floor division (broadcasting)
torch floor_divide <t1> <t2>torch floor_divide <t1> <t2>hypot
elementwise hypotenuse (broadcasting)
torch hypot <t1> <t2>torch hypot <t1> <t2>copysign
magnitude of a, sign of b (broadcasting)
torch copysign <t1> <t2>torch copysign <t1> <t2>xlogy
elementwise x*log(y) (broadcasting)
torch xlogy <t1> <t2>torch xlogy <t1> <t2>logaddexp
elementwise log(e^a + e^b) (broadcasting)
torch logaddexp <t1> <t2>torch logaddexp <t1> <t2>lerp
a + weight*(b - a) (scalar or tensor weight)
torch lerp <t1> <t2> <weight>torch lerp <t1> <t2> <weight>addcmul
a + value * b * c
torch addcmul <t1> <t2> <t3> [--value <Scalar>]torch addcmul <t1> <t2> <t3> [--value <Scalar>]addcdiv
a + value * b / c
torch addcdiv <t1> <t2> <t3> [--value <Scalar>]torch addcdiv <t1> <t2> <t3> [--value <Scalar>]bitwise_and
bitwise AND of int tensors (broadcasting)
torch bitwise_and <t1> <t2>torch bitwise_and <t1> <t2>bitwise_or
bitwise OR of int tensors (broadcasting)
torch bitwise_or <t1> <t2>torch bitwise_or <t1> <t2>bitwise_xor
bitwise XOR of int tensors (broadcasting)
torch bitwise_xor <t1> <t2>torch bitwise_xor <t1> <t2>bitwise_not
bitwise NOT of an int tensor
torch bitwise_not <t1>torch bitwise_not <t1>bitwise_left_shift
left shift of int tensors (broadcasting)
torch bitwise_left_shift <t1> <t2>torch bitwise_left_shift <t1> <t2>bitwise_right_shift
right shift of int tensors (broadcasting)
torch bitwise_right_shift <t1> <t2>torch bitwise_right_shift <t1> <t2>