torch — PyTorch 2.7 documentation (original) (raw)
Computes the absolute value of each element in input
.
Alias for torch.abs()
Computes the inverse cosine of each element in input
.
Alias for torch.acos().
Returns a new tensor with the inverse hyperbolic cosine of the elements of input
.
Alias for torch.acosh().
Adds other
, scaled by alpha
, to input
.
Performs the element-wise division of tensor1
by tensor2
, multiplies the result by the scalar value
and adds it to input
.
Performs the element-wise multiplication of tensor1
by tensor2
, multiplies the result by the scalar value
and adds it to input
.
Computes the element-wise angle (in radians) of the given input
tensor.
Returns a new tensor with the arcsine of the elements of input
.
Alias for torch.asin().
Returns a new tensor with the inverse hyperbolic sine of the elements of input
.
Alias for torch.asinh().
Returns a new tensor with the arctangent of the elements of input
.
Alias for torch.atan().
Returns a new tensor with the inverse hyperbolic tangent of the elements of input
.
Alias for torch.atanh().
Element-wise arctangent of inputi/otheri\text{input}_{i} / \text{other}_{i} with consideration of the quadrant.
Alias for torch.atan2().
Computes the bitwise NOT of the given input tensor.
Computes the bitwise AND of input
and other
.
Computes the bitwise OR of input
and other
.
Computes the bitwise XOR of input
and other
.
Computes the left arithmetic shift of input
by other
bits.
Computes the right arithmetic shift of input
by other
bits.
Returns a new tensor with the ceil of the elements of input
, the smallest integer greater than or equal to each element.
Clamps all elements in input
into the range [ min, max ].
Alias for torch.clamp().
Computes the element-wise conjugate of the given input
tensor.
Create a new floating-point tensor with the magnitude of input
and the sign of other
, elementwise.
Returns a new tensor with the cosine of the elements of input
.
Returns a new tensor with the hyperbolic cosine of the elements of input
.
Returns a new tensor with each of the elements of input
converted from angles in degrees to radians.
Divides each element of the input input
by the corresponding element of other
.
Alias for torch.div().
Alias for torch.special.digamma().
Alias for torch.special.erf().
Alias for torch.special.erfc().
Alias for torch.special.erfinv().
Returns a new tensor with the exponential of the elements of the input tensor input
.
Alias for torch.special.exp2().
Alias for torch.special.expm1().
fake_quantize_per_channel_affine
Returns a new tensor with the data in input
fake quantized per channel using scale
, zero_point
, quant_min
and quant_max
, across the channel specified by axis
.
fake_quantize_per_tensor_affine
Returns a new tensor with the data in input
fake quantized using scale
, zero_point
, quant_min
and quant_max
.
Alias for torch.trunc()
Raises input
to the power of exponent
, elementwise, in double precision.
Returns a new tensor with the floor of the elements of input
, the largest integer less than or equal to each element.
Applies C++'s std::fmod entrywise.
Computes the fractional portion of each element in input
.
Decomposes input
into mantissa and exponent tensors such that input=mantissa×2exponent\text{input} = \text{mantissa} \times 2^{\text{exponent}}.
Estimates the gradient of a function g:Rn→Rg : \mathbb{R}^n \rightarrow \mathbb{R} in one or more dimensions using the second-order accurate central differences method and either first or second order estimates at the boundaries.
Returns a new tensor containing imaginary values of the self
tensor.
Multiplies input
by 2 ** other
.
Does a linear interpolation of two tensors start
(given by input
) and end
based on a scalar or tensor weight
and returns the resulting out
tensor.
Computes the natural logarithm of the absolute value of the gamma function on input
.
Returns a new tensor with the natural logarithm of the elements of input
.
Returns a new tensor with the logarithm to the base 10 of the elements of input
.
Returns a new tensor with the natural logarithm of (1 + input
).
Returns a new tensor with the logarithm to the base 2 of the elements of input
.
Logarithm of the sum of exponentiations of the inputs.
Logarithm of the sum of exponentiations of the inputs in base-2.
Computes the element-wise logical AND of the given input tensors.
Computes the element-wise logical NOT of the given input tensor.
Computes the element-wise logical OR of the given input tensors.
Computes the element-wise logical XOR of the given input tensors.
Alias for torch.special.logit().
Given the legs of a right triangle, return its hypotenuse.
Alias for torch.special.i0().
Alias for torch.special.gammainc().
Alias for torch.special.gammaincc().
Multiplies input
by other
.
Alias for torch.mul().
Alias for torch.special.multigammaln().
Replaces NaN
, positive infinity, and negative infinity values in input
with the values specified by nan
, posinf
, and neginf
, respectively.
Returns a new tensor with the negative of the elements of input
.
Alias for torch.neg()
Return the next floating-point value after input
towards other
, elementwise.
Alias for torch.special.polygamma().
Returns input
.
Takes the power of each element in input
with exponent
and returns a tensor with the result.
Applies batch normalization on a 4D (NCHW) quantized tensor.
Applies a 1D max pooling over an input quantized tensor composed of several input planes.
Applies a 2D max pooling over an input quantized tensor composed of several input planes.
Returns a new tensor with each of the elements of input
converted from angles in radians to degrees.
Returns a new tensor containing real values of the self
tensor.
Returns a new tensor with the reciprocal of the elements of input
Computes Python's modulus operation entrywise.
Rounds elements of input
to the nearest integer.
Returns a new tensor with the reciprocal of the square-root of each of the elements of input
.
Alias for torch.special.expit().
Returns a new tensor with the signs of the elements of input
.
This function is an extension of torch.sign() to complex tensors.
Tests if each element of input
has its sign bit set or not.
Returns a new tensor with the sine of the elements of input
.
Alias for torch.special.sinc().
Returns a new tensor with the hyperbolic sine of the elements of input
.
Alias for torch.nn.functional.softmax().
Returns a new tensor with the square-root of the elements of input
.
Returns a new tensor with the square of the elements of input
.
Subtracts other
, scaled by alpha
, from input
.
Alias for torch.sub().
Returns a new tensor with the tangent of the elements of input
.
Returns a new tensor with the hyperbolic tangent of the elements of input
.
Alias for torch.div() with rounding_mode=None
.
Returns a new tensor with the truncated integer values of the elements of input
.
Alias for torch.special.xlogy().