torch.randn
torch.randn(size, , out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False) -> Tensor
Returns a tensor filled with random numbers from a normal
   distribution with mean 0 and variance 1 (also called the
   standard normal distribution).
  \text{out}_{i} \sim \mathcal{N}(0, 1)

The shape of the tensor is defined by the variable argument "size".
Parameters:
      size (int...) -- a sequence of integers defining the
      shape of the output tensor. Can be a variable number of
      arguments or a collection like a list or tuple.
Keyword Arguments:
      * generator ("torch.Generator", optional) -- a pseudorandom
        number generator for sampling
  * **out** (*Tensor**, **optional*) -- the output tensor.

  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor. Default: if "None", uses a global default
    (see "torch.set_default_tensor_type()").


(see "torch.set_default_tensor_type()").
  * **layout** ("torch.layout", optional) -- the desired layout of
    returned Tensor. Default: "torch.strided".

  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if "None", uses the current device
    for the default tensor type (see
    "torch.set_default_tensor_type()"). "device" will be the CPU
    for CPU tensor types and the current CUDA device for CUDA
    tensor types.

  * **requires_grad** (*bool**, **optional*) -- If autograd should
    record operations on the returned tensor. Default: "False".

  * **pin_memory** (*bool**, **optional*) -- If set, returned
    tensor would be allocated in the pinned memory. Works only for
    CPU tensors. Default: "False".

Example:
  >>> torch.randn(4)
  tensor([-2.1436,  0.9966,  2.3426, -0.6366])
  >>> torch.randn(2, 3)
  tensor([[ 1.5954,  2.8929, -1.0923],


tensor([[ 1.5954,  2.8929, -1.0923],
              [ 1.1719, -0.4709, -0.1996]])


torch.linalg.lu_solve
torch.linalg.lu_solve(LU, pivots, B, *, left=True, adjoint=False, out=None) -> Tensor
Computes the solution of a square system of linear equations with a
   unique solution given an LU decomposition.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, this function
   computes the solution X \in \mathbb{K}^{n \times k} of the linear
   system associated to A \in \mathbb{K}^{n \times n}, B \in
   \mathbb{K}^{n \times k}, which is defined as
  AX = B

where A is given factorized as returned by "lu_factor()".
If "left"= False, this function returns the matrix X \in
   \mathbb{K}^{n \times k} that solves the system
  XA = B\mathrlap{\qquad A \in \mathbb{K}^{k \times k}, B \in
  \mathbb{K}^{n \times k}.}

If  "adjoint"= True (and "left"= True), given an LU
   factorization of :math:`A this function function returns the X \in
   \mathbb{K}^{n \times k} that solves the system


\mathbb{K}^{n \times k} that solves the system
  A^{\text{H}}X = B\mathrlap{\qquad A \in \mathbb{K}^{k \times k},
  B \in \mathbb{K}^{n \times k}.}

where A^{\text{H}} is the conjugate transpose when A is complex,
   and the transpose when A is real-valued. The "left"= False case
   is analogous.
Supports inputs of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if the inputs are batches of
   matrices then the output has the same batch dimensions.
Parameters:
      * LU (Tensor) -- tensor of shape (, n, n) (or (, k,
        k) if "left"= True) where *** is zero or more batch
        dimensions as returned by "lu_factor()".
  * **pivots** (*Tensor*) -- tensor of shape *(*, n)* (or *(*, k)*
    if "left"*= True*) where *** is zero or more batch dimensions
    as returned by "lu_factor()".

  * **B** (*Tensor*) -- right-hand side tensor of shape *(*, n,
    k)*.

Keyword Arguments:


k)*.
Keyword Arguments:
      * left (bool, optional) -- whether to solve the system
        AX=B or XA = B. Default: True.
  * **adjoint** (*bool**, **optional*) -- whether to solve the
    system AX=B or A^{\text{H}}X = B. Default: *False*.

  * **out** (*Tensor**, **optional*) -- output tensor. Ignored if
    *None*. Default: *None*.

Examples:
  >>> A = torch.randn(3, 3)
  >>> LU, pivots = torch.linalg.lu_factor(A)
  >>> B = torch.randn(3, 2)
  >>> X = torch.linalg.lu_solve(LU, pivots, B)
  >>> torch.allclose(A @ X, B)
  True

  >>> B = torch.randn(3, 3, 2)   # Broadcasting rules apply: A is broadcasted
  >>> X = torch.linalg.lu_solve(LU, pivots, B)
  >>> torch.allclose(A @ X, B)
  True

  >>> B = torch.randn(3, 5, 3)
  >>> X = torch.linalg.lu_solve(LU, pivots, B, left=False)
  >>> torch.allclose(X @ A, B)
  True

  >>> B = torch.randn(3, 3, 4)   # Now solve for A^T


X = torch.linalg.lu_solve(LU, pivots, B, adjoint=True)
      >>> torch.allclose(A.mT @ X, B)
      True


torch.sgn
torch.sgn(input, *, out=None) -> Tensor
This function is an extension of torch.sign() to complex tensors.
   It computes a new tensor whose elements have the same angles as the
   corresponding elements of "input" and absolute values (i.e.
   magnitudes) of one for complex tensors and is equivalent to
   torch.sign() for non-complex tensors.
  \text{out}_{i} = \begin{cases}                 0 &
  |\text{{input}}_i| == 0 \\
  \frac{{\text{{input}}_i}}{|{\text{{input}}_i}|} &
  \text{otherwise}                 \end{cases}

Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> t = torch.tensor([3+4j, 7-24j, 0, 1+2j])
  >>> t.sgn()
  tensor([0.6000+0.8000j, 0.2800-0.9600j, 0.0000+0.0000j, 0.4472+0.8944j])


torch.matrix_power
torch.matrix_power(input, n, *, out=None) -> Tensor
Alias for "torch.linalg.matrix_power()"


torch.Tensor.storage_type
Tensor.storage_type() -> type
Returns the type of the underlying storage.


torch.cuda.OutOfMemoryError
exception torch.cuda.OutOfMemoryError
Exception raised when CUDA is out of memory


torch.as_tensor
torch.as_tensor(data, dtype=None, device=None) -> Tensor
Converts "data" into a tensor, sharing data and preserving autograd
   history if possible.
If "data" is already a tensor with the requested dtype and device
   then "data" itself is returned, but if "data" is a tensor with a
   different dtype or device then it's copied as if using
   data.to(dtype=dtype, device=device).
If "data" is a NumPy array (an ndarray) with the same dtype and
   device then a tensor is constructed using "torch.from_numpy()".
See also:
 "torch.tensor()" never shares its data and creates a new "leaf
 tensor" (see Autograd mechanics).

Parameters:
      * data (array_like) -- Initial data for the tensor. Can be
        a list, tuple, NumPy "ndarray", scalar, and other types.
  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor. Default: if "None", infers data type from
    "data".


"data".
  * **device** ("torch.device", optional) -- the device of the
    constructed tensor. If None and data is a tensor then the
    device of data is used. If None and data is not a tensor then
    the result tensor is constructed on the CPU.

Example:
  >>> a = numpy.array([1, 2, 3])
  >>> t = torch.as_tensor(a)
  >>> t
  tensor([ 1,  2,  3])
  >>> t[0] = -1
  >>> a
  array([-1,  2,  3])

  >>> a = numpy.array([1, 2, 3])
  >>> t = torch.as_tensor(a, device=torch.device('cuda'))
  >>> t
  tensor([ 1,  2,  3])
  >>> t[0] = -1
  >>> a
  array([1,  2,  3])


torch.nn.functional.softplus
torch.nn.functional.softplus(input, beta=1, threshold=20) -> Tensor
Applies element-wise, the function \text{Softplus}(x) =
   \frac{1}{\beta} * \log(1 + \exp(\beta * x)).
For numerical stability the implementation reverts to the linear
   function when input \times \beta > threshold.
See "Softplus" for more details.


torch.tile
torch.tile(input, dims) -> Tensor
Constructs a tensor by repeating the elements of "input". The
   "dims" argument specifies the number of repetitions in each
   dimension.
If "dims" specifies fewer dimensions than "input" has, then ones
   are prepended to "dims" until all dimensions are specified. For
   example, if "input" has shape (8, 6, 4, 2) and "dims" is (2, 2),
   then "dims" is treated as (1, 1, 2, 2).
Analogously, if "input" has fewer dimensions than "dims" specifies,
   then "input" is treated as if it were unsqueezed at dimension zero
   until it has as many dimensions as "dims" specifies. For example,
   if "input" has shape (4, 2) and "dims" is (3, 3, 2, 2), then
   "input" is treated as if it had the shape (1, 1, 4, 2).
Note:
 This function is similar to NumPy's tile function.

Parameters:
      * input (Tensor) -- the tensor whose elements to repeat.
  * **dims** (*tuple*) -- the number of repetitions per dimension.

Example:


Example:
  >>> x = torch.tensor([1, 2, 3])
  >>> x.tile((2,))
  tensor([1, 2, 3, 1, 2, 3])
  >>> y = torch.tensor([[1, 2], [3, 4]])
  >>> torch.tile(y, (2, 2))
  tensor([[1, 2, 1, 2],
          [3, 4, 3, 4],
          [1, 2, 1, 2],
          [3, 4, 3, 4]])


Conv3d
class torch.nn.Conv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
Applies a 3D convolution over an input signal composed of several
   input planes.
In the simplest case, the output value of the layer with input size
   (N, C_{in}, D, H, W) and output (N, C_{out}, D_{out}, H_{out},
   W_{out}) can be precisely described as:
  out(N_i, C_{out_j}) = bias(C_{out_j}) +
  \sum_{k = 0}^{C_{in} - 1} weight(C_{out_j}, k) \star input(N_i,
  k)

where \star is the valid 3D cross-correlation operator
This module supports TensorFloat32.
On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.

"stride" controls the stride for the cross-correlation.

"padding" controls the amount of padding applied to the input. It
     can be either a string {'valid', 'same'} or a tuple of ints


giving the amount of implicit padding applied on both sides.

"dilation" controls the spacing between the kernel points; also
     known as the Ã  trous algorithm. It is harder to describe, but
     this link has a nice visualization of what "dilation" does.

"groups" controls the connections between inputs and outputs.
     "in_channels" and "out_channels" must both be divisible by
     "groups". For example,
* At groups=1, all inputs are convolved to all outputs.

* At groups=2, the operation becomes equivalent to having two
  conv layers side by side, each seeing half the input
  channels and producing half the output channels, and both
  subsequently concatenated.

* At groups= "in_channels", each input channel is convolved
  with its own set of filters (of size
  \frac{\text{out\_channels}}{\text{in\_channels}}).

The parameters "kernel_size", "stride", "padding", "dilation" can
   either be:


either be:
  * a single "int" -- in which case the same value is used for the
    depth, height and width dimension

  * a "tuple" of three ints -- in which case, the first *int* is
    used for the depth dimension, the second *int* for the height
    dimension and the third *int* for the width dimension

Note:
 When *groups == in_channels* and *out_channels == K *
 in_channels*, where *K* is a positive integer, this operation is
 also known as a "depthwise convolution".In other words, for an
 input of size (N, C_{in}, L_{in}), a depthwise convolution with a
 depthwise multiplier *K* can be performed with the arguments
 (C_\text{in}=C_\text{in}, C_\text{out}=C_\text{in} \times
 \text{K}, ..., \text{groups}=C_\text{in}).

Note:
 In some circumstances when given tensors on a CUDA device and
 using CuDNN, this operator may select a nondeterministic
 algorithm to increase performance. If this is undesirable, you


can try to make the operation deterministic (potentially at a
     performance cost) by setting "torch.backends.cudnn.deterministic
     = True". See Reproducibility for more information.
Note:
 "padding='valid'" is the same as no padding. "padding='same'"
 pads the input so the output has the shape as the input. However,
 this mode doesn't support any stride values other than 1.

Note:
 This module supports complex data types i.e. "complex32,
 complex64, complex128".

Parameters:
      * in_channels (int) -- Number of channels in the input
        image
  * **out_channels** (*int*) -- Number of channels produced by the
    convolution

  * **kernel_size** (*int** or **tuple*) -- Size of the convolving
    kernel

  * **stride** (*int** or **tuple**, **optional*) -- Stride of the
    convolution. Default: 1

  * **padding** (*int**, **tuple** or **str**, **optional*) --
    Padding added to all six sides of the input. Default: 0


padding_mode (str, optional) -- "'zeros'",
        "'reflect'", "'replicate'" or "'circular'". Default: "'zeros'"

dilation (int or tuple, optional) -- Spacing
    between kernel elements. Default: 1

groups (int, optional) -- Number of blocked
    connections from input channels to output channels. Default: 1

bias (bool, optional) -- If "True", adds a learnable
    bias to the output. Default: "True"

Shape:
      * Input: (N, C_{in}, D_{in}, H_{in}, W_{in}) or (C_{in}, D_{in},
        H_{in}, W_{in})
  * Output: (N, C_{out}, D_{out}, H_{out}, W_{out}) or (C_{out},
    D_{out}, H_{out}, W_{out}), where

       D_{out} = \left\lfloor\frac{D_{in} + 2 \times
       \text{padding}[0] - \text{dilation}[0]       \times
       (\text{kernel\_size}[0] - 1) - 1}{\text{stride}[0]} +
       1\right\rfloor

       H_{out} = \left\lfloor\frac{H_{in} + 2 \times


\text{padding}[1] - \text{dilation}[1]       \times
           (\text{kernel_size}[1] - 1) - 1}{\text{stride}[1]} +
           1\right\rfloor
       W_{out} = \left\lfloor\frac{W_{in} + 2 \times
       \text{padding}[2] - \text{dilation}[2]       \times
       (\text{kernel\_size}[2] - 1) - 1}{\text{stride}[2]} +
       1\right\rfloor

Variables:
      * weight (Tensor) -- the learnable weights of the module
        of shape (\text{out_channels},
        \frac{\text{in_channels}}{\text{groups}},
        \text{kernel_size[0]}, \text{kernel_size[1]},
        \text{kernel_size[2]}). The values of these weights are
        sampled from \mathcal{U}(-\sqrt{k}, \sqrt{k}) where k =
        \frac{groups}{C_\text{in} *
        \prod_{i=0}^{2}\text{kernel_size}[i]}
  * **bias** (*Tensor*) -- the learnable bias of the module of
    shape (out_channels). If "bias" is "True", then the values of
    these weights are sampled from \mathcal{U}(-\sqrt{k},


\sqrt{k}) where k = \frac{groups}{C_\text{in} *
        \prod_{i=0}^{2}\text{kernel_size}[i]}
Examples:
  >>> # With square kernels and equal stride
  >>> m = nn.Conv3d(16, 33, 3, stride=2)
  >>> # non-square kernels and unequal stride and with padding
  >>> m = nn.Conv3d(16, 33, (3, 5, 2), stride=(2, 1, 1), padding=(4, 2, 0))
  >>> input = torch.randn(20, 16, 10, 50, 100)
  >>> output = m(input)


torch.Tensor.cuda
Tensor.cuda(device=None, non_blocking=False, memory_format=torch.preserve_format) -> Tensor
Returns a copy of this object in CUDA memory.
If this object is already in CUDA memory and on the correct device,
   then no copy is performed and the original object is returned.
Parameters:
      * device ("torch.device") -- The destination GPU device.
        Defaults to the current CUDA device.
  * **non_blocking** (*bool*) -- If "True" and the source is in
    pinned memory, the copy will be asynchronous with respect to
    the host. Otherwise, the argument has no effect. Default:
    "False".

  * **memory_format** ("torch.memory_format", optional) -- the
    desired memory format of returned Tensor. Default:
    "torch.preserve_format".


torch.Tensor.exponential_
Tensor.exponential_(lambd=1, *, generator=None) -> Tensor
Fills "self" tensor with elements drawn from the exponential
   distribution:
  f(x) = \lambda e^{-\lambda x}


torch.randn_like
torch.randn_like(input, *, dtype=None, layout=None, device=None, requires_grad=False, memory_format=torch.preserve_format) -> Tensor
Returns a tensor with the same size as "input" that is filled with
   random numbers from a normal distribution with mean 0 and variance
   1. "torch.randn_like(input)" is equivalent to
   "torch.randn(input.size(), dtype=input.dtype, layout=input.layout,
   device=input.device)".
Parameters:
      input (Tensor) -- the size of "input" will determine size
      of the output tensor.
Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned Tensor. Default: if "None", defaults to the dtype
        of "input".
  * **layout** ("torch.layout", optional) -- the desired layout of
    returned tensor. Default: if "None", defaults to the layout of
    "input".

  * **device** ("torch.device", optional) -- the desired device of


returned tensor. Default: if "None", defaults to the device of
        "input".
  * **requires_grad** (*bool**, **optional*) -- If autograd should
    record operations on the returned tensor. Default: "False".

  * **memory_format** ("torch.memory_format", optional) -- the
    desired memory format of returned Tensor. Default:
    "torch.preserve_format".


torch.nn.functional.poisson_nll_loss
torch.nn.functional.poisson_nll_loss(input, target, log_input=True, full=False, size_average=None, eps=1e-08, reduce=None, reduction='mean')
Poisson negative log likelihood loss.
See "PoissonNLLLoss" for details.
Parameters:
      * input (Tensor) -- expectation of underlying Poisson
        distribution.
  * **target** (*Tensor*) -- random sample target \sim
    \text{Poisson}(input).

  * **log_input** (*bool*) -- if "True" the loss is computed as
    \exp(\text{input}) - \text{target} * \text{input}, if "False"
    then loss is \text{input} - \text{target} *
    \log(\text{input}+\text{eps}). Default: "True"

  * **full** (*bool*) -- whether to compute full loss, i. e. to
    add the Stirling approximation term. Default: "False"
    \text{target} * \log(\text{target}) - \text{target} + 0.5 *
    \log(2 * \pi * \text{target}).


\log(2 * \pi * \text{target}).
  * **size_average** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged over each
    loss element in the batch. Note that for some losses, there
    multiple elements per sample. If the field "size_average" is
    set to "False", the losses are instead summed for each
    minibatch. Ignored when reduce is "False". Default: "True"

  * **eps** (*float**, **optional*) -- Small value to avoid
    evaluation of \log(0) when "log_input"="False". Default: 1e-8

  * **reduce** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged or summed
    over observations for each minibatch depending on
    "size_average". When "reduce" is "False", returns a loss per
    batch element instead and ignores "size_average". Default:
    "True"

  * **reduction** (*str**, **optional*) -- Specifies the reduction


to apply to the output: "'none'" | "'mean'" | "'sum'".
        "'none'": no reduction will be applied, "'mean'": the sum of
        the output will be divided by the number of elements in the
        output, "'sum'": the output will be summed. Note:
        "size_average" and "reduce" are in the process of being
        deprecated, and in the meantime, specifying either of those
        two args will override "reduction". Default: "'mean'"
Return type:
      Tensor


torch.foreach_log1p
torch.foreach_log1p(self: List[Tensor]) -> None
Apply "torch.log1p()" to each Tensor of the input list.


torch.max
torch.max(input) -> Tensor
Returns the maximum value of all elements in the "input" tensor.
Warning:
 This function produces deterministic (sub)gradients unlike
 "max(dim=0)"

Parameters:
      input (Tensor) -- the input tensor.
Example:
  >>> a = torch.randn(1, 3)
  >>> a
  tensor([[ 0.6763,  0.7445, -2.2369]])
  >>> torch.max(a)
  tensor(0.7445)

torch.max(input, dim, keepdim=False, *, out=None)
Returns a namedtuple "(values, indices)" where "values" is the
   maximum value of each row of the "input" tensor in the given
   dimension "dim". And "indices" is the index location of each
   maximum value found (argmax).
If "keepdim" is "True", the output tensors are of the same size as
   "input" except in the dimension "dim" where they are of size 1.
   Otherwise, "dim" is squeezed (see "torch.squeeze()"), resulting in
   the output tensors having 1 fewer dimension than "input".
Note:


Note:
 If there are multiple maximal values in a reduced row then the
 indices of the first maximal value are returned.

Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the dimension to reduce.

  * **keepdim** (*bool*) -- whether the output tensor has "dim"
    retained or not. Default: "False".

Keyword Arguments:
      out (tuple, optional) -- the result tuple of two
      output tensors (max, max_indices)
Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[-1.2360, -0.2942, -0.1222,  0.8475],
          [ 1.1949, -1.1127, -2.2379, -0.6702],
          [ 1.5717, -0.9207,  0.1297, -1.8768],
          [-0.6172,  1.0036, -0.6060, -0.2432]])
  >>> torch.max(a, 1)
  torch.return_types.max(values=tensor([0.8475, 1.1949, 1.5717, 1.0036]), indices=tensor([3, 0, 0, 1]))

torch.max(input, other, *, out=None) -> Tensor
See "torch.maximum()".


torch.Tensor.storage
Tensor.storage() -> torch.TypedStorage
Returns the underlying "TypedStorage".
Warning:
 "TypedStorage" is deprecated. It will be removed in the future,
 and "UntypedStorage" will be the only storage class. To access
 the "UntypedStorage" directly, use "Tensor.untyped_storage()".


torch.Tensor.cross
Tensor.cross(other, dim=None) -> Tensor
See "torch.cross()"


torch.corrcoef
torch.corrcoef(input) -> Tensor
Estimates the Pearson product-moment correlation coefficient matrix
   of the variables given by the "input" matrix, where rows are the
   variables and columns are the observations.
Note:
 The correlation coefficient matrix R is computed using the
 covariance matrix C as given by R_{ij} = \frac{ C_{ij} } { \sqrt{
 C_{ii} * C_{jj} } }

Note:
 Due to floating point rounding, the resulting array may not be
 Hermitian and its diagonal elements may not be 1. The real and
 imaginary values are clipped to the interval [-1, 1] in an
 attempt to improve this situation.

Parameters:
      input (Tensor) -- A 2D matrix containing multiple
      variables and observations, or a Scalar or 1D vector
      representing a single variable.
Returns:
      (Tensor) The correlation coefficient matrix of the variables.
See also: "torch.cov()" covariance matrix.
Example:


Example:
  >>> x = torch.tensor([[0, 1, 2], [2, 1, 0]])
  >>> torch.corrcoef(x)
  tensor([[ 1., -1.],
          [-1.,  1.]])
  >>> x = torch.randn(2, 4)
  >>> x
  tensor([[-0.2678, -0.0908, -0.3766,  0.2780],
          [-0.5812,  0.1535,  0.2387,  0.2350]])
  >>> torch.corrcoef(x)
  tensor([[1.0000, 0.3582],
          [0.3582, 1.0000]])
  >>> torch.corrcoef(x[0])
  tensor(1.)


torch.bitwise_left_shift
torch.bitwise_left_shift(input, other, *, out=None) -> Tensor
Computes the left arithmetic shift of "input" by "other" bits. The
   input tensor must be of integral type. This operator supports
   broadcasting to a common shape and type promotion.
The operation applied is:
  \text{out}_i = \text{input}_i << \text{other}_i

Parameters:
      * input (Tensor or Scalar) -- the first input tensor
  * **other** (*Tensor** or **Scalar*) -- the second input tensor

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> torch.bitwise_left_shift(torch.tensor([-1, -2, 3], dtype=torch.int8), torch.tensor([1, 0, 3], dtype=torch.int8))
  tensor([-2, -2, 24], dtype=torch.int8)


torch.heaviside
torch.heaviside(input, values, *, out=None) -> Tensor
Computes the Heaviside step function for each element in "input".
   The Heaviside step function is defined as:
  \text{{heaviside}}(input, values) = \begin{cases}     0, &
  \text{if input < 0}\\     values, & \text{if input == 0}\\
  1, & \text{if input > 0} \end{cases}

Parameters:
      * input (Tensor) -- the input tensor.
  * **values** (*Tensor*) -- The values to use where "input" is
    zero.

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> input = torch.tensor([-1.5, 0, 2.0])
  >>> values = torch.tensor([0.5])
  >>> torch.heaviside(input, values)
  tensor([0.0000, 0.5000, 1.0000])
  >>> values = torch.tensor([1.2, -2.0, 3.5])
  >>> torch.heaviside(input, values)
  tensor([0., -2., 1.])


float16_dynamic_qconfig
torch.quantization.qconfig.float16_dynamic_qconfig
alias of QConfig(activation=functools.partial(,
   dtype=torch.float16, is_dynamic=True){},
   weight=functools.partial(,
   dtype=torch.float16){})


torch.cuda.get_allocator_backend
torch.cuda.get_allocator_backend()
Returns a string describing the active allocator backend as set by
   "PYTORCH_CUDA_ALLOC_CONF". Currently available backends are
   "native" (PyTorch's native caching allocator) and
   cudaMallocAsync` (CUDA's built-in asynchronous allocator).
Note:
 See Memory management for details on choosing the allocator
 backend.

Return type:
      str


torch.Tensor.cholesky_solve
Tensor.cholesky_solve(input2, upper=False) -> Tensor
See "torch.cholesky_solve()"


torch.nn.functional.upsample
torch.nn.functional.upsample(input, size=None, scale_factor=None, mode='nearest', align_corners=None)
Upsamples the input to either the given "size" or the given
   "scale_factor"
Warning:
 This function is deprecated in favor of
 "torch.nn.functional.interpolate()". This is equivalent with
 "nn.functional.interpolate(...)".

Note:
 This operation may produce nondeterministic gradients when given
 tensors on a CUDA device. See Reproducibility for more
 information.

The algorithm used for upsampling is determined by "mode".
Currently temporal, spatial and volumetric upsampling are
   supported, i.e. expected inputs are 3-D, 4-D or 5-D in shape.
The input dimensions are interpreted in the form: mini-batch x
   channels x [optional depth] x [optional height] x width.
The modes available for upsampling are: nearest, linear (3D-
   only), bilinear, bicubic (4D-only), trilinear (5D-only)


Parameters:
      * input (Tensor) -- the input tensor
  * **size** (*int** or **Tuple**[**int**] or **Tuple**[**int**,
    **int**] or **Tuple**[**int**, **int**, **int**]*) -- output
    spatial size.

  * **scale_factor** (*float** or **Tuple**[**float**]*) --
    multiplier for spatial size. Has to match input size if it is
    a tuple.

  * **mode** (*str*) -- algorithm used for upsampling: "'nearest'"
    | "'linear'" | "'bilinear'" | "'bicubic'" | "'trilinear'".
    Default: "'nearest'"

  * **align_corners** (*bool**, **optional*) -- Geometrically, we
    consider the pixels of the input and output as squares rather
    than points. If set to "True", the input and output tensors
    are aligned by the center points of their corner pixels,
    preserving the values at the corner pixels. If set to "False",
    the input and output tensors are aligned by the corner points


of their corner pixels, and the interpolation uses edge value
        padding for out-of-boundary values, making this operation
        independent of input size when "scale_factor" is kept the
        same. This only has an effect when "mode" is "'linear'",
        "'bilinear'", "'bicubic'" or "'trilinear'". Default: "False"
Note:
 With "mode='bicubic'", it's possible to cause overshoot, in other
 words it can produce negative values or values greater than 255
 for images. Explicitly call "result.clamp(min=0, max=255)" if you
 want to reduce the overshoot when displaying the image.

Warning:
 With "align_corners = True", the linearly interpolating modes
 (*linear*, *bilinear*, and *trilinear*) don't proportionally
 align the output and input pixels, and thus the output values can
 depend on the input size. This was the default behavior for these
 modes up to version 0.3.1. Since then, the default behavior is


"align_corners = False". See "Upsample" for concrete examples on
     how this affects the outputs.


torch.nn.functional.relu_
torch.nn.functional.relu_(input) -> Tensor
In-place version of "relu()".


torch.Tensor.storage_offset
Tensor.storage_offset() -> int
Returns "self" tensor's offset in the underlying storage in terms
   of number of storage elements (not bytes).
Example:
  >>> x = torch.tensor([1, 2, 3, 4, 5])
  >>> x.storage_offset()
  0
  >>> x[3:].storage_offset()
  3


Hardswish
class torch.ao.nn.quantized.Hardswish(scale, zero_point)
This is the quantized version of "Hardswish".
Parameters:
      * scale -- quantization scale of the output tensor
  * **zero_point** -- quantization zero point of the output tensor


torch.linalg.vecdot
torch.linalg.vecdot(x, y, *, dim=- 1, out=None) -> Tensor
Computes the dot product of two batches of vectors along a
   dimension.
In symbols, this function computes
  \sum_{i=1}^n \overline{x_i}y_i.

over the dimension "dim" where \overline{x_i} denotes the conjugate
   for complex vectors, and it is the identity for real vectors.
Supports input of half, bfloat16, float, double, cfloat, cdouble
   and integral dtypes. It also supports broadcasting.
Parameters:
      * x (Tensor) -- first batch of vectors of shape (, n)*.
  * **y** (*Tensor*) -- second batch of vectors of shape *(*, n)*.

Keyword Arguments:
      * dim (int) -- Dimension along which to compute the dot
        product. Default: -1.
  * **out** (*Tensor**, **optional*) -- output tensor. Ignored if
    *None*. Default: *None*.

Examples:
  >>> v1 = torch.randn(3, 2)
  >>> v2 = torch.randn(3, 2)
  >>> linalg.vecdot(v1, v2)


linalg.vecdot(v1, v2)
      tensor([ 0.3223,  0.2815, -0.1944])
      >>> torch.vdot(v1[0], v2[0])
      tensor(0.3223)


torch.Tensor.stride
Tensor.stride(dim) -> tuple or int
Returns the stride of "self" tensor.
Stride is the jump necessary to go from one element to the next one
   in the specified dimension "dim". A tuple of all strides is
   returned when no argument is passed in. Otherwise, an integer value
   is returned as the stride in the particular dimension "dim".
Parameters:
      dim (int, optional) -- the desired dimension in which
      stride is required
Example:
  >>> x = torch.tensor([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
  >>> x.stride()
  (5, 1)
  >>> x.stride(0)
  5
  >>> x.stride(-1)
  1


torch.Tensor.bitwise_left_shift_
Tensor.bitwise_left_shift_(other) -> Tensor
In-place version of "bitwise_left_shift()"


torch.Tensor.logsumexp
Tensor.logsumexp(dim, keepdim=False) -> Tensor
See "torch.logsumexp()"


ReplicationPad1d
class torch.nn.ReplicationPad1d(padding)
Pads the input tensor using replication of the input boundary.
For N-dimensional padding, use "torch.nn.functional.pad()".
Parameters:
      padding (int, tuple) -- the size of the padding. If is
      int, uses the same padding in all boundaries. If a 2-tuple,
      uses (\text{padding_left}, \text{padding_right})
Shape:
      * Input: (C, W_{in}) or (N, C, W_{in}).
  * Output: (C, W_{out}) or (N, C, W_{out}), where

    W_{out} = W_{in} + \text{padding\_left} +
    \text{padding\_right}

Examples:
  >>> m = nn.ReplicationPad1d(2)
  >>> input = torch.arange(8, dtype=torch.float).reshape(1, 2, 4)
  >>> input
  tensor([[[0., 1., 2., 3.],
           [4., 5., 6., 7.]]])
  >>> m(input)
  tensor([[[0., 0., 0., 1., 2., 3., 3., 3.],
           [4., 4., 4., 5., 6., 7., 7., 7.]]])
  >>> # using different paddings for different sides


m = nn.ReplicationPad1d((3, 1))
      >>> m(input)
      tensor([[[0., 0., 0., 0., 1., 2., 3., 3.],
               [4., 4., 4., 4., 5., 6., 7., 7.]]])


torch.linalg.qr
torch.linalg.qr(A, mode='reduced', *, out=None)
Computes the QR decomposition of a matrix.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, the full QR
   decomposition of a matrix A \in \mathbb{K}^{m \times n} is
   defined as
  A = QR\mathrlap{\qquad Q \in \mathbb{K}^{m \times m}, R \in
  \mathbb{K}^{m \times n}}

where Q is orthogonal in the real case and unitary in the complex
   case, and R is upper triangular with real diagonal (even in the
   complex case).
When m > n (tall matrix), as R is upper triangular, its last m
   - n rows are zero. In this case, we can drop the last m - n
   columns of Q to form the reduced QR decomposition:
  A = QR\mathrlap{\qquad Q \in \mathbb{K}^{m \times n}, R \in
  \mathbb{K}^{n \times n}}

The reduced QR decomposition agrees with the full QR decomposition
   when n >= m (wide matrix).
Supports input of float, double, cfloat and cdouble dtypes. Also


supports batches of matrices, and if "A" is a batch of matrices
   then the output has the same batch dimensions.
The parameter "mode" chooses between the full and reduced QR
   decomposition. If "A" has shape (, m, n), denoting k = min(m,
   n)*

"mode"= 'reduced' (default): Returns (Q, R) of shapes (, m,
     k), (, k, n) respectively. It is always differentiable.

"mode"= 'complete': Returns (Q, R) of shapes (, m, m),
     (, m, n) respectively. It is differentiable for m <= n.

"mode"= 'r': Computes only the reduced R. Returns (Q, R)
     with Q empty and R of shape (, k, n)*. It is never
     differentiable.

Differences with numpy.linalg.qr:

"mode"= 'raw' is not implemented.

Unlike numpy.linalg.qr, this function always returns a tuple of
     two tensors. When "mode"= 'r', the Q tensor is an empty
     tensor.

Warning:
 The elements in the diagonal of *R* are not necessarily positive.


As such, the returned QR decomposition is only unique up to the
     sign of the diagonal of R. Therefore, different platforms, like
     NumPy, or inputs on different devices, may produce different
     valid decompositions.
Warning:
 The QR decomposition is only well-defined if the first *k =
 min(m, n)* columns of every matrix in "A" are linearly
 independent. If this condition is not met, no error will be
 thrown, but the QR produced may be incorrect and its autodiff may
 fail or produce incorrect results.

Parameters:
      * A (Tensor) -- tensor of shape (, m, n)* where *** is
        zero or more batch dimensions.
  * **mode** (*str**, **optional*) -- one of *'reduced'*,
    *'complete'*, *'r'*. Controls the shape of the returned
    tensors. Default: *'reduced'*.

Keyword Arguments:
      out (tuple, optional) -- output tuple of two tensors.
      Ignored if None. Default: None.
Returns:
      A named tuple (Q, R).


Returns:
      A named tuple (Q, R).
Examples:
  >>> A = torch.tensor([[12., -51, 4], [6, 167, -68], [-4, 24, -41]])
  >>> Q, R = torch.linalg.qr(A)
  >>> Q
  tensor([[-0.8571,  0.3943,  0.3314],
          [-0.4286, -0.9029, -0.0343],
          [ 0.2857, -0.1714,  0.9429]])
  >>> R
  tensor([[ -14.0000,  -21.0000,   14.0000],
          [   0.0000, -175.0000,   70.0000],
          [   0.0000,    0.0000,  -35.0000]])
  >>> (Q @ R).round()
  tensor([[  12.,  -51.,    4.],
          [   6.,  167.,  -68.],
          [  -4.,   24.,  -41.]])
  >>> (Q.T @ Q).round()
  tensor([[ 1.,  0.,  0.],
          [ 0.,  1., -0.],
          [ 0., -0.,  1.]])
  >>> Q2, R2 = torch.linalg.qr(A, mode='r')
  >>> Q2
  tensor([])
  >>> torch.equal(R, R2)
  True
  >>> A = torch.randn(3, 4, 5)
  >>> Q, R = torch.linalg.qr(A, mode='complete')
  >>> torch.dist(Q @ R, A)
  tensor(1.6099e-06)


tensor(1.6099e-06)
      >>> torch.dist(Q.mT @ Q, torch.eye(4))
      tensor(6.2158e-07)


torch.cuda.get_device_capability
torch.cuda.get_device_capability(device=None)
Gets the cuda capability of a device.
Parameters:
      device (torch.device or int, optional) -- device
      for which to return the device capability. This function is a
      no-op if this argument is a negative integer. It uses the
      current device, given by "current_device()", if "device" is
      "None" (default).
Returns:
      the major and minor cuda capability of the device
Return type:
      tuple(int, int)


torch.Tensor.fliplr
Tensor.fliplr() -> Tensor
See "torch.fliplr()"


torch.Tensor.addmm_
Tensor.addmm_(mat1, mat2, *, beta=1, alpha=1) -> Tensor
In-place version of "addmm()"


torch.Tensor.logical_or_
Tensor.logical_or_() -> Tensor
In-place version of "logical_or()"


torch.cuda.get_arch_list
torch.cuda.get_arch_list()
Returns list CUDA architectures this library was compiled for.
Return type:
      List[str]


torch.Tensor.bitwise_right_shift_
Tensor.bitwise_right_shift_(other) -> Tensor
In-place version of "bitwise_right_shift()"


torch._foreach_lgamma
torch._foreach_lgamma(self: List[Tensor]) -> List[Tensor]
Apply "torch.lgamma()" to each Tensor of the input list.


torch.is_complex
torch.is_complex(input)
Returns True if the data type of "input" is a complex data type
   i.e., one of "torch.complex64", and "torch.complex128".
Parameters:
      input (Tensor) -- the input tensor.


torch.foreach_erfc
torch.foreach_erfc(self: List[Tensor]) -> None
Apply "torch.erfc()" to each Tensor of the input list.


CosineAnnealingLR
class torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max, eta_min=0, last_epoch=- 1, verbose=False)
Set the learning rate of each parameter group using a cosine
   annealing schedule, where \eta_{max} is set to the initial lr and
   T_{cur} is the number of epochs since the last restart in SGDR:
  \begin{aligned}     \eta_t & = \eta_{min} +
  \frac{1}{2}(\eta_{max} - \eta_{min})\left(1     +
  \cos\left(\frac{T_{cur}}{T_{max}}\pi\right)\right),     &
  T_{cur} \neq (2k+1)T_{max}; \\     \eta_{t+1} & = \eta_{t} +
  \frac{1}{2}(\eta_{max} - \eta_{min})     \left(1 -
  \cos\left(\frac{1}{T_{max}}\pi\right)\right),     & T_{cur} =
  (2k+1)T_{max}. \end{aligned}

When last_epoch=-1, sets initial lr as lr. Notice that because the
   schedule is defined recursively, the learning rate can be
   simultaneously modified outside this scheduler by other operators.
   If the learning rate is set solely by this scheduler, the learning


rate at each step becomes:
  \eta_t = \eta_{min} + \frac{1}{2}(\eta_{max} -
  \eta_{min})\left(1 +
  \cos\left(\frac{T_{cur}}{T_{max}}\pi\right)\right)

It has been proposed in SGDR: Stochastic Gradient Descent with Warm
   Restarts. Note that this only implements the cosine annealing part
   of SGDR, and not the restarts.
Parameters:
      * optimizer (Optimizer) -- Wrapped optimizer.
  * **T_max** (*int*) -- Maximum number of iterations.

  * **eta_min** (*float*) -- Minimum learning rate. Default: 0.

  * **last_epoch** (*int*) -- The index of last epoch. Default:
    -1.

  * **verbose** (*bool*) -- If "True", prints a message to stdout
    for each update. Default: "False".

get_last_lr()
  Return last computed learning rate by current scheduler.

load_state_dict(state_dict)
  Loads the schedulers state.

  Parameters:
     **state_dict** (*dict*) -- scheduler state. Should be an


object returned from a call to "state_dict()".
print_lr(is_verbose, group, lr, epoch=None)
  Display the current learning rate.

state_dict()
  Returns the state of the scheduler as a "dict".

  It contains an entry for every variable in self.__dict__ which
  is not the optimizer.


torch.foreach_tan
torch.foreach_tan(self: List[Tensor]) -> None
Apply "torch.tan()" to each Tensor of the input list.


torch.is_floating_point
torch.is_floating_point(input)
Returns True if the data type of "input" is a floating point data
   type i.e., one of "torch.float64", "torch.float32",
   "torch.float16", and "torch.bfloat16".
Parameters:
      input (Tensor) -- the input tensor.


Conv1d
class torch.ao.nn.quantized.Conv1d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
Applies a 1D convolution over a quantized input signal composed of
   several quantized input planes.
For details on input arguments, parameters, and implementation see
   "Conv1d".
Note:
 Only *zeros* is supported for the "padding_mode" argument.

Note:
 Only *torch.quint8* is supported for the input data type.

Variables:
      * weight (Tensor) -- packed tensor derived from the
        learnable weight parameter.
  * **scale** (*Tensor*) -- scalar for the output scale

  * **zero_point** (*Tensor*) -- scalar for the output zero point

See "Conv1d" for other attributes.
Examples:
  >>> m = nn.quantized.Conv1d(16, 33, 3, stride=2)
  >>> input = torch.randn(20, 16, 100)
  >>> # quantize input to quint8


quantize input to quint8
  >>> q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0,
  ...                                     dtype=torch.quint8)
  >>> output = m(q_input)

classmethod from_float(mod)
  Creates a quantized module from a float module or qparams_dict.

  Parameters:
     **mod** (*Module*) -- a float module, either produced by
     torch.ao.quantization utilities or provided by the user


disable_observer
class torch.quantization.fake_quantize.disable_observer(mod)
Disable observation for this module, if applicable. Example usage:
  # model is any PyTorch model
  model.apply(torch.ao.quantization.disable_observer)


torch.autograd.graph.Node.metadata
abstract Node.metadata()
Returns the metadata.
Return type:
      dict


torch.Tensor.arccosh_
Tensor.arccosh_()
acosh_() -> Tensor
In-place version of "arccosh()"


DTypeConfig
class torch.ao.quantization.backend_config.DTypeConfig(input_dtype=None, output_dtype=None, weight_dtype=None, bias_dtype=None, is_dynamic=None)
Config object that specifies the supported data types passed as
   arguments to quantize ops in the reference model spec, for input
   and output activations, weights, and biases.
For example, consider the following reference model:
  quant1 - [dequant1 - fp32_linear - quant2] - dequant2

The pattern in the square brackets refers to the reference pattern
   of statically quantized linear. Setting the input dtype as
   torch.quint8 in the DTypeConfig means we pass in torch.quint8
   as the dtype argument to the first quantize op (quant1). Similarly,
   setting the output dtype as torch.quint8 means we pass in
   torch.quint8 as the dtype argument to the second quantize op
   (quant2).
Note that the dtype here does not refer to the interface dtypes of


the op. For example, the "input dtype" here is not the dtype of the
   input tensor passed to the quantized linear op. Though it can still
   be the same as the interface dtype, this is not always the case,
   e.g. the interface dtype is fp32 in dynamic quantization but the
   "input dtype" specified in the DTypeConfig would still be quint8.
   The semantics of dtypes here are the same as the semantics of the
   dtypes specified in the observers.
These dtypes are matched against the ones specified in the userâs
   QConfig. If there is a match, and the QConfig satisfies the
   constraints specified in the DTypeConfig (if any), then we will
   quantize the given pattern using this DTypeConfig. Otherwise, the
   QConfig is ignored and the pattern will not be quantized.
Example usage:
  >>> dtype_config1 = DTypeConfig(
  ...     input_dtype=torch.quint8,
  ...     output_dtype=torch.quint8,
  ...     weight_dtype=torch.qint8,
  ...     bias_dtype=torch.float)


...     bias_dtype=torch.float)
  >>> dtype_config2 = DTypeConfig(
  ...     input_dtype=DTypeWithConstraints(
  ...         dtype=torch.quint8,
  ...         quant_min_lower_bound=0,
  ...         quant_max_upper_bound=255,
  ...     ),
  ...     output_dtype=DTypeWithConstraints(
  ...         dtype=torch.quint8,
  ...         quant_min_lower_bound=0,
  ...         quant_max_upper_bound=255,
  ...     ),
  ...     weight_dtype=DTypeWithConstraints(
  ...         dtype=torch.qint8,
  ...         quant_min_lower_bound=-128,
  ...         quant_max_upper_bound=127,
  ...     ),
  ...     bias_dtype=torch.float)

  >>> dtype_config1.input_dtype
  torch.quint8

  >>> dtype_config2.input_dtype
  torch.quint8

  >>> dtype_config2.input_dtype_with_constraints
  DTypeWithConstraints(dtype=torch.quint8, quant_min_lower_bound=0, quant_max_upper_bound=255, scale_min_lower_bound=None, scale_max_upper_bound=None)


classmethod from_dict(dtype_config_dict)
  Create a "DTypeConfig" from a dictionary with the following
  items (all optional):
     "input_dtype": torch.dtype or "DTypeWithConstraints"
     "output_dtype": torch.dtype or "DTypeWithConstraints"
     "weight_dtype": torch.dtype or "DTypeWithConstraints"
     "bias_type": torch.dtype "is_dynamic": bool

  Return type:
     *DTypeConfig*

to_dict()
  Convert this "DTypeConfig" to a dictionary with the items
  described in "from_dict()".

  Return type:
     *Dict*[str, *Any*]


BCEWithLogitsLoss
class torch.nn.BCEWithLogitsLoss(weight=None, size_average=None, reduce=None, reduction='mean', pos_weight=None)
This loss combines a Sigmoid layer and the BCELoss in one
   single class. This version is more numerically stable than using a
   plain Sigmoid followed by a BCELoss as, by combining the
   operations into one layer, we take advantage of the log-sum-exp
   trick for numerical stability.
The unreduced (i.e. with "reduction" set to "'none'") loss can be
   described as:
  \ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = - w_n
  \left[ y_n \cdot \log \sigma(x_n) + (1 - y_n) \cdot \log (1 -
  \sigma(x_n)) \right],

where N is the batch size. If "reduction" is not "'none'" (default
   "'mean'"), then
  \ell(x, y) = \begin{cases}     \operatorname{mean}(L), &
  \text{if reduction} = \text{`mean';}\\
  \operatorname{sum}(L),  & \text{if reduction} = \text{`sum'.}
  \end{cases}


\end{cases}
This is used for measuring the error of a reconstruction in for
   example an auto-encoder. Note that the targets t[i] should be
   numbers between 0 and 1.
It's possible to trade off recall and precision by adding weights
   to positive examples. In the case of multi-label classification the
   loss can be described as:
  \ell_c(x, y) = L_c = \{l_{1,c},\dots,l_{N,c}\}^\top, \quad
  l_{n,c} = - w_{n,c} \left[ p_c y_{n,c} \cdot \log
  \sigma(x_{n,c}) + (1 - y_{n,c}) \cdot \log (1 - \sigma(x_{n,c}))
  \right],

where c is the class number (c > 1 for multi-label binary
   classification, c = 1 for single-label binary classification), n is
   the number of the sample in the batch and p_c is the weight of the
   positive answer for the class c.
p_c > 1 increases the recall, p_c < 1 increases the precision.
For example, if a dataset contains 100 positive and 300 negative
   examples of a single class, then pos_weight for the class should


be equal to \frac{300}{100}=3. The loss would act as if the dataset
   contains 3\times 100=300 positive examples.
Examples:
  >>> target = torch.ones([10, 64], dtype=torch.float32)  # 64 classes, batch size = 10
  >>> output = torch.full([10, 64], 1.5)  # A prediction (logit)
  >>> pos_weight = torch.ones([64])  # All weights are equal to 1
  >>> criterion = torch.nn.BCEWithLogitsLoss(pos_weight=pos_weight)
  >>> criterion(output, target)  # -log(sigmoid(1.5))
  tensor(0.20...)

Parameters:
      * weight (Tensor, optional) -- a manual rescaling
        weight given to the loss of each batch element. If given, has
        to be a Tensor of size nbatch.
  * **size_average** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged over each
    loss element in the batch. Note that for some losses, there
    are multiple elements per sample. If the field "size_average"


is set to "False", the losses are instead summed for each
        minibatch. Ignored when "reduce" is "False". Default: "True"
  * **reduce** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged or summed
    over observations for each minibatch depending on
    "size_average". When "reduce" is "False", returns a loss per
    batch element instead and ignores "size_average". Default:
    "True"

  * **reduction** (*str**, **optional*) -- Specifies the reduction
    to apply to the output: "'none'" | "'mean'" | "'sum'".
    "'none'": no reduction will be applied, "'mean'": the sum of
    the output will be divided by the number of elements in the
    output, "'sum'": the output will be summed. Note:
    "size_average" and "reduce" are in the process of being
    deprecated, and in the meantime, specifying either of those
    two args will override "reduction". Default: "'mean'"


pos_weight (Tensor, optional) -- a weight of
        positive examples. Must be a vector with length equal to the
        number of classes.

Shape:
         * Input: (*), where * means any number of dimensions.
     * Target: (*), same shape as the input.

     * Output: scalar. If "reduction" is "'none'", then (*), same
       shape as input.

  Examples:

     >>> loss = nn.BCEWithLogitsLoss()
     >>> input = torch.randn(3, requires_grad=True)
     >>> target = torch.empty(3).random_(2)
     >>> output = loss(input, target)
     >>> output.backward()


torch.Tensor.nextafter_
Tensor.nextafter_(other) -> Tensor
In-place version of "nextafter()"


torch.Tensor.qscheme
Tensor.qscheme() -> torch.qscheme
Returns the quantization scheme of a given QTensor.


torch.autograd.gradcheck
torch.autograd.gradcheck(func, inputs, *, eps=1e-06, atol=1e-05, rtol=0.001, raise_exception=True, check_sparse_nnz=False, nondet_tol=0.0, check_undefined_grad=True, check_grad_dtypes=False, check_batched_grad=False, check_batched_forward_grad=False, check_forward_ad=False, check_backward_ad=True, fast_mode=False)
Check gradients computed via small finite differences against
   analytical gradients w.r.t. tensors in "inputs" that are of
   floating point or complex type and with "requires_grad=True".
The check between numerical and analytical gradients uses
   "allclose()".
For most of the complex functions we consider for optimization
   purposes, no notion of Jacobian exists. Instead, gradcheck verifies
   if the numerical and analytical values of the Wirtinger and
   Conjugate Wirtinger derivatives are consistent. Because the
   gradient computation is done under the assumption that the overall


function has a real-valued output, we treat functions with complex
   output in a special way. For these functions, gradcheck is applied
   to two real-valued functions corresponding to taking the real
   components of the complex outputs for the first, and taking the
   imaginary components of the complex outputs for the second. For
   more details, check out Autograd for Complex Numbers.
Note:
 The default values are designed for "input" of double precision.
 This check will likely fail if "input" is of less precision,
 e.g., "FloatTensor".

Warning:
 If any checked tensor in "input" has overlapping memory, i.e.,
 different indices pointing to the same memory address (e.g., from
 "torch.expand()"), this check will likely fail because the
 numerical gradients computed by point perturbation at such
 indices will change values at all other indices that share the
 same memory address.

Parameters:


same memory address.
Parameters:
      * func (function) -- a Python function that takes Tensor
        inputs and returns a Tensor or a tuple of Tensors
  * **inputs** (*tuple of Tensor** or **Tensor*) -- inputs to the
    function

  * **eps** (*float**, **optional*) -- perturbation for finite
    differences

  * **atol** (*float**, **optional*) -- absolute tolerance

  * **rtol** (*float**, **optional*) -- relative tolerance

  * **raise_exception** (*bool**, **optional*) -- indicating
    whether to raise an exception if the check fails. The
    exception gives more information about the exact nature of the
    failure. This is helpful when debugging gradchecks.

  * **check_sparse_nnz** (*bool**, **optional*) -- if True,
    gradcheck allows for SparseTensor input, and for any
    SparseTensor at input, gradcheck will perform check at nnz
    positions only.

  * **nondet_tol** (*float**, **optional*) -- tolerance for non-


determinism. When running identical inputs through the
        differentiation, the results must either match exactly
        (default, 0.0) or be within this tolerance.
  * **check_undefined_grad** (*bool**, **optional*) -- if True,
    check if undefined output grads are supported and treated as
    zeros, for "Tensor" outputs.

  * **check_batched_grad** (*bool**, **optional*) -- if True,
    check if we can compute batched gradients using prototype vmap
    support. Defaults to False.

  * **check_batched_forward_grad** (*bool**, **optional*) -- if
    True, checks if we can compute batched forward gradients using
    forward ad and prototype vmap support. Defaults to False.

  * **check_forward_ad** (*bool**, **optional*) -- if True, check
    that the gradients computed with forward mode AD match the
    numerical ones. Defaults to False.

  * **check_backward_ad** (*bool**, **optional*) -- if False, do


not perform any checks that rely on backward mode AD to be
        implemented. Defaults to True.
  * **fast_mode** (*bool**, **optional*) -- Fast mode for
    gradcheck and gradgradcheck is currently only implemented for
    R to R functions. If none of the inputs and outputs are
    complex a faster implementation of gradcheck that no longer
    computes the entire jacobian is run; otherwise, we fall back
    to the slow implementation.

Returns:
      True if all differences satisfy allclose condition
Return type:
      bool


MaxPool3d
class torch.nn.MaxPool3d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)
Applies a 3D max pooling over an input signal composed of several
   input planes.
In the simplest case, the output value of the layer with input size
   (N, C, D, H, W), output (N, C, D_{out}, H_{out}, W_{out}) and
   "kernel_size" (kD, kH, kW) can be precisely described as:
  \begin{aligned}     \text{out}(N_i, C_j, d, h, w) ={} &
  \max_{k=0, \ldots, kD-1} \max_{m=0, \ldots, kH-1} \max_{n=0,
  \ldots, kW-1} \\                                       &
  \text{input}(N_i, C_j, \text{stride[0]} \times d + k,
  \text{stride[1]} \times h + m, \text{stride[2]} \times w + n)
  \end{aligned}

If "padding" is non-zero, then the input is implicitly padded with
   negative infinity on both sides for "padding" number of points.
   "dilation" controls the spacing between the kernel points. It is


harder to describe, but this link has a nice visualization of what
   "dilation" does.
Note:
 When ceil_mode=True, sliding windows are allowed to go off-bounds
 if they start within the left padding or the input. Sliding
 windows that would start in the right padded region are ignored.

The parameters "kernel_size", "stride", "padding", "dilation" can
   either be:
  * a single "int" -- in which case the same value is used for the
    depth, height and width dimension

  * a "tuple" of three ints -- in which case, the first *int* is
    used for the depth dimension, the second *int* for the height
    dimension and the third *int* for the width dimension

Parameters:
      * kernel_size (Union[int, Tuple[int, int,
        int]]) -- the size of the window to take a max over
  * **stride** (*Union**[**int**, **Tuple**[**int**, **int**,
    **int**]**]*) -- the stride of the window. Default value is
    "kernel_size"


"kernel_size"
  * **padding** (*Union**[**int**, **Tuple**[**int**, **int**,
    **int**]**]*) -- Implicit negative infinity padding to be
    added on all three sides

  * **dilation** (*Union**[**int**, **Tuple**[**int**, **int**,
    **int**]**]*) -- a parameter that controls the stride of
    elements in the window

  * **return_indices** (*bool*) -- if "True", will return the max
    indices along with the outputs. Useful for
    "torch.nn.MaxUnpool3d" later

  * **ceil_mode** (*bool*) -- when True, will use *ceil* instead
    of *floor* to compute the output shape

Shape:
      * Input: (N, C, D_{in}, H_{in}, W_{in}) or (C, D_{in}, H_{in},
        W_{in}).
  * Output: (N, C, D_{out}, H_{out}, W_{out}) or (C, D_{out},
    H_{out}, W_{out}), where

       D_{out} = \left\lfloor\frac{D_{in} + 2 \times
       \text{padding}[0] - \text{dilation}[0] \times
       (\text{kernel\_size}[0] - 1) - 1}{\text{stride}[0]} +


1\right\rfloor
       H_{out} = \left\lfloor\frac{H_{in} + 2 \times
       \text{padding}[1] - \text{dilation}[1] \times
       (\text{kernel\_size}[1] - 1) - 1}{\text{stride}[1]} +
       1\right\rfloor

       W_{out} = \left\lfloor\frac{W_{in} + 2 \times
       \text{padding}[2] - \text{dilation}[2] \times
       (\text{kernel\_size}[2] - 1) - 1}{\text{stride}[2]} +
       1\right\rfloor

Examples:
  >>> # pool of square window of size=3, stride=2
  >>> m = nn.MaxPool3d(3, stride=2)
  >>> # pool of non-square window
  >>> m = nn.MaxPool3d((3, 2, 2), stride=(2, 1, 2))
  >>> input = torch.randn(20, 16, 50, 44, 31)
  >>> output = m(input)


torch.Tensor.index_reduce
Tensor.index_reduce()


torch.hspmm
torch.hspmm(mat1, mat2, *, out=None) -> Tensor
Performs a matrix multiplication of a sparse COO matrix "mat1" and
   a strided matrix "mat2". The result is a (1 + 1)-dimensional hybrid
   COO matrix.
Parameters:
      * mat1 (Tensor) -- the first sparse matrix to be matrix
        multiplied
  * **mat2** (*Tensor*) -- the second strided matrix to be matrix
    multiplied

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.


torch.sparse.sampled_addmm
torch.sparse.sampled_addmm(input, mat1, mat2, *, beta=1., alpha=1., out=None) -> Tensor
Performs a matrix multiplication of the dense matrices "mat1" and
   "mat2" at the locations specified by the sparsity pattern of
   "input". The matrix "input" is added to the final result.
Mathematically this performs the following operation:
  \text{out} = \alpha\ (\text{mat1} \mathbin{@}
  \text{mat2})*\text{spy}(\text{input}) + \beta\ \text{input}

where \text{spy}(\text{input}) is the sparsity pattern matrix of
   "input", "alpha" and "beta" are the scaling factors.
   \text{spy}(\text{input}) has value 1 at the positions where "input"
   has non-zero values, and 0 elsewhere.
Note:
 "input" must be a sparse CSR tensor. "mat1" and "mat2" must be
 dense tensors.

Parameters:
      * input (Tensor) -- a sparse CSR matrix of shape (m, n)
        to be added and used to compute the sampled matrix
        multiplication


multiplication
  * **mat1** (*Tensor*) -- a dense matrix of shape *(m, k)* to be
    multiplied

  * **mat2** (*Tensor*) -- a dense matrix of shape *(k, n)* to be
    multiplied

Keyword Arguments:
      * beta (Number, optional) -- multiplier for "input"
        (\beta)
  * **alpha** (*Number**, **optional*) -- multiplier for mat1 @
    mat2 (\alpha)

  * **out** (*Tensor**, **optional*) -- output tensor. Ignored if
    *None*. Default: *None*.

Examples:
  >>> input = torch.eye(3, device='cuda').to_sparse_csr()
  >>> mat1 = torch.randn(3, 5, device='cuda')
  >>> mat2 = torch.randn(5, 3, device='cuda')
  >>> torch.sparse.sampled_addmm(input, mat1, mat2)
  tensor(crow_indices=tensor([0, 1, 2, 3]),
      col_indices=tensor([0, 1, 2]),
      values=tensor([ 0.2847, -0.7805, -0.1900]), device='cuda:0',
      size=(3, 3), nnz=3, layout=torch.sparse_csr)
  >>> torch.sparse.sampled_addmm(input, mat1, mat2).to_dense()


tensor([[ 0.2847,  0.0000,  0.0000],
          [ 0.0000, -0.7805,  0.0000],
          [ 0.0000,  0.0000, -0.1900]], device='cuda:0')
      >>> torch.sparse.sampled_addmm(input, mat1, mat2, beta=0.5, alpha=0.5)
      tensor(crow_indices=tensor([0, 1, 2, 3]),
          col_indices=tensor([0, 1, 2]),
          values=tensor([ 0.1423, -0.3903, -0.0950]), device='cuda:0',
          size=(3, 3), nnz=3, layout=torch.sparse_csr)


torch.take
torch.take(input, index) -> Tensor
Returns a new tensor with the elements of "input" at the given
   indices. The input tensor is treated as if it were viewed as a 1-D
   tensor. The result takes the same shape as the indices.
Parameters:
      * input (Tensor) -- the input tensor.
  * **index** (*LongTensor*) -- the indices into tensor

Example:
  >>> src = torch.tensor([[4, 3, 5],
  ...                     [6, 7, 8]])
  >>> torch.take(src, torch.tensor([0, 2, 5]))
  tensor([ 4,  5,  8])


torch.Tensor.equal
Tensor.equal(other) -> bool
See "torch.equal()"


default_weight_only_qconfig
torch.quantization.qconfig.default_weight_only_qconfig
alias of QConfig(activation=,
   weight=functools.partial(,
   observer=,
   quant_min=-128, quant_max=127, dtype=torch.qint8,
   qscheme=torch.per_tensor_symmetric, reduce_range=False){})


torch.vander
torch.vander(x, N=None, increasing=False) -> Tensor
Generates a Vandermonde matrix.
The columns of the output matrix are elementwise powers of the
   input vector x^{(N-1)}, x^{(N-2)}, ..., x^0. If increasing is True,
   the order of the columns is reversed x^0, x^1, ..., x^{(N-1)}. Such
   a matrix with a geometric progression in each row is named for
   Alexandre-Theophile Vandermonde.
Parameters:
      * x (Tensor) -- 1-D input tensor.
  * **N** (*int**, **optional*) -- Number of columns in the
    output. If N is not specified, a square array is returned (N =
    len(x)).

  * **increasing** (*bool**, **optional*) -- Order of the powers
    of the columns. If True, the powers increase from left to
    right, if False (the default) they are reversed.

Returns:
      Vandermonde matrix. If increasing is False, the first column is
      x^{(N-1)}, the second x^{(N-2)} and so forth. If increasing is


True, the columns are x^0, x^1, ..., x^{(N-1)}.
Return type:
      Tensor
Example:
  >>> x = torch.tensor([1, 2, 3, 5])
  >>> torch.vander(x)
  tensor([[  1,   1,   1,   1],
          [  8,   4,   2,   1],
          [ 27,   9,   3,   1],
          [125,  25,   5,   1]])
  >>> torch.vander(x, N=3)
  tensor([[ 1,  1,  1],
          [ 4,  2,  1],
          [ 9,  3,  1],
          [25,  5,  1]])
  >>> torch.vander(x, N=3, increasing=True)
  tensor([[ 1,  1,  1],
          [ 1,  2,  4],
          [ 1,  3,  9],
          [ 1,  5, 25]])


NLLLoss
class torch.nn.NLLLoss(weight=None, size_average=None, ignore_index=- 100, reduce=None, reduction='mean')
The negative log likelihood loss. It is useful to train a
   classification problem with C classes.
If provided, the optional argument "weight" should be a 1D Tensor
   assigning weight to each of the classes. This is particularly
   useful when you have an unbalanced training set.
The input given through a forward call is expected to contain
   log-probabilities of each class. input has to be a Tensor of size
   either (minibatch, C) or (minibatch, C, d_1, d_2, ..., d_K) with K
   \geq 1 for the K-dimensional case. The latter is useful for
   higher dimension inputs, such as computing NLL loss per-pixel for
   2D images.
Obtaining log-probabilities in a neural network is easily achieved
   by adding a  LogSoftmax  layer in the last layer of your network.
   You may use CrossEntropyLoss instead, if you prefer not to add an
   extra layer.


extra layer.
The target that this loss expects should be a class index in the
   range [0, C-1] where C = number of classes; if ignore_index is
   specified, this loss also accepts this class index (this index may
   not necessarily be in the class range).
The unreduced (i.e. with "reduction" set to "'none'") loss can be
   described as:
  \ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = - w_{y_n}
  x_{n,y_n}, \quad w_{c} = \text{weight}[c] \cdot \mathbb{1}\{c
  \not= \text{ignore\_index}\},

where x is the input, y is the target, w is the weight, and N is
   the batch size. If "reduction" is not "'none'" (default "'mean'"),
   then
  \ell(x, y) = \begin{cases}     \sum_{n=1}^N
  \frac{1}{\sum_{n=1}^N w_{y_n}} l_n, &     \text{if reduction} =
  \text{`mean';}\\     \sum_{n=1}^N l_n,  &     \text{if
  reduction} = \text{`sum'.} \end{cases}

Parameters:
      * weight (Tensor, optional) -- a manual rescaling


weight given to each class. If given, it has to be a Tensor of
        size C. Otherwise, it is treated as if having all ones.
  * **size_average** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged over each
    loss element in the batch. Note that for some losses, there
    are multiple elements per sample. If the field "size_average"
    is set to "False", the losses are instead summed for each
    minibatch. Ignored when "reduce" is "False". Default: "None"

  * **ignore_index** (*int**, **optional*) -- Specifies a target
    value that is ignored and does not contribute to the input
    gradient. When "size_average" is "True", the loss is averaged
    over non-ignored targets.

  * **reduce** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged or summed
    over observations for each minibatch depending on


"size_average". When "reduce" is "False", returns a loss per
        batch element instead and ignores "size_average". Default:
        "None"
  * **reduction** (*str**, **optional*) -- Specifies the reduction
    to apply to the output: "'none'" | "'mean'" | "'sum'".
    "'none'": no reduction will be applied, "'mean'": the weighted
    mean of the output is taken, "'sum'": the output will be
    summed. Note: "size_average" and "reduce" are in the process
    of being deprecated, and in the meantime, specifying either of
    those two args will override "reduction". Default: "'mean'"

Shape:
      * Input: (N, C) or (C), where C = number of classes, or (N, C,
        d_1, d_2, ..., d_K) with K \geq 1 in the case of
        K-dimensional loss.
  * Target: (N) or (), where each value is 0 \leq
    \text{targets}[i] \leq C-1, or (N, d_1, d_2, ..., d_K) with K
    \geq 1 in the case of K-dimensional loss.


\geq 1 in the case of K-dimensional loss.
  * Output: If "reduction" is "'none'", shape (N) or (N, d_1, d_2,
    ..., d_K) with K \geq 1 in the case of K-dimensional loss.
    Otherwise, scalar.

Examples:
  >>> m = nn.LogSoftmax(dim=1)
  >>> loss = nn.NLLLoss()
  >>> # input is of size N x C = 3 x 5
  >>> input = torch.randn(3, 5, requires_grad=True)
  >>> # each element in target has to have 0 <= value < C
  >>> target = torch.tensor([1, 0, 4])
  >>> output = loss(m(input), target)
  >>> output.backward()
  >>>
  >>>
  >>> # 2D loss example (used, for example, with image inputs)
  >>> N, C = 5, 4
  >>> loss = nn.NLLLoss()
  >>> # input is of size N x C x height x width
  >>> data = torch.randn(N, 16, 10, 10)
  >>> conv = nn.Conv2d(16, C, (3, 3))
  >>> m = nn.LogSoftmax(dim=1)
  >>> # each element in target has to have 0 <= value < C
  >>> target = torch.empty(N, 8, 8, dtype=torch.long).random_(0, C)


output = loss(m(conv(data)), target)
      >>> output.backward()


CUDAPluggableAllocator
class torch.cuda.CUDAPluggableAllocator(path_to_so_file, alloc_fn_name, free_fn_name)
CUDA memory allocator loaded from a so file.
Memory allocators are compiled in .so files and loaded dynamically
   using ctypes. To change the active allocator use the
   "torch.memory.cuda.change_current_allocator()" function.
Parameters:
      * path_to_so_file (str) -- Path in the filesystem to the
        .so file containing the allocator functions
  * **alloc_fn_name** (*str*) -- Name of the function to perform
    the memory allocation in the so file. The signature must be:
    void* alloc_fn_name(ssize_t size, int device, cudaStream_t
    stream);

  * **free_fn_name** (*str*) -- Name of the function to perform
    the memory release in the so file. The signature must be: void
    free_fn_name(void* ptr, size_t size, cudaStream_t stream);

Warning:
 This is currently supported only in unix OSs

Note:


Note:
 See Memory management for details on creating and using a custom
 allocator


torch.set_deterministic_debug_mode
torch.set_deterministic_debug_mode(debug_mode)
Sets the debug mode for deterministic operations.
Note:
 This is an alternative interface for
 "torch.use_deterministic_algorithms()". Refer to that function's
 documentation for details about affected operations.

Parameters:
      debug_mode (str or int) -- If "default" or 0, don't
      error or warn on nondeterministic operations. If "warn" or 1,
      warn on nondeterministic operations. If "error" or 2, error on
      nondeterministic operations.


torch.Tensor.is_coalesced
Tensor.is_coalesced() -> bool
Returns "True" if "self" is a sparse COO tensor that is coalesced,
   "False" otherwise.
Warning:
 Throws an error if "self" is not a sparse COO tensor.

See "coalesce()" and uncoalesced tensors.


ReLU6
class torch.ao.nn.quantized.ReLU6(inplace=False)
Applies the element-wise function:
\text{ReLU6}(x) = \min(\max(x_0, x), q(6)), where x_0 is the
   zero_point, and q(6) is the quantized representation of number 6.
Parameters:
      inplace (bool) -- can optionally do the operation in-
      place. Default: "False"
Shape:
      * Input: (N, *) where *** means, any number of additional
        dimensions
  * Output: (N, *), same shape as the input

[image]
Examples:
  >>> m = nn.quantized.ReLU6()
  >>> input = torch.randn(2)
  >>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32)
  >>> output = m(input)


torch.cumsum
torch.cumsum(input, dim, *, dtype=None, out=None) -> Tensor
Returns the cumulative sum of elements of "input" in the dimension
   "dim".
For example, if "input" is a vector of size N, the result will also
   be a vector of size N, with elements.
  y_i = x_1 + x_2 + x_3 + \dots + x_i

Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the dimension to do the operation over

Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned tensor. If specified, the input tensor is casted
        to "dtype" before the operation is performed. This is useful
        for preventing data type overflows. Default: None.
  * **out** (*Tensor**, **optional*) -- the output tensor.

Example:
  >>> a = torch.randn(10)
  >>> a
  tensor([-0.8286, -0.4890,  0.5155,  0.8443,  0.1865, -0.1752, -2.0595,
           0.1850, -1.1571, -0.4243])
  >>> torch.cumsum(a, dim=0)


torch.cumsum(a, dim=0)
      tensor([-0.8286, -1.3175, -0.8020,  0.0423,  0.2289,  0.0537, -2.0058,
              -1.8209, -2.9780, -3.4022])


torch.autograd.graph.Node.name
abstract Node.name()
Returns the name.
Example:
  >>> import torch
  >>> a = torch.tensor([0., 0., 0.], requires_grad=True)
  >>> b = a.clone()
  >>> assert isinstance(b.grad_fn, torch.autograd.graph.Node)
  >>> print(b.grad_fn.name())
  CloneBackward0

Return type:
      str


set_multithreading_enabled
class torch.autograd.set_multithreading_enabled(mode)
Context-manager that sets multithreaded backwards on or off.
"set_multithreading_enabled" will enable or disable multithreaded
   backwards based on its argument "mode". It can be used as a
   context-manager or as a function.
This context manager is thread local; it will not affect
   computation in other threads.
Parameters:
      mode (bool) -- Flag whether to enable multithreaded
      backwards ("True"), or disable ("False").
Note:
 This API does not apply to forward-mode AD.


torch.Tensor.is_pinned
Tensor.is_pinned()
Returns true if this tensor resides in pinned memory.


torch.signal.windows.gaussian
torch.signal.windows.gaussian(M, *, std=1.0, sym=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Computes a window with a gaussian waveform.
The gaussian window is defined as follows:
  w_n = \exp{\left(-\left(\frac{n}{2\sigma}\right)^2\right)}

The window is normalized to 1 (maximum value is 1). However, the 1
   doesn't appear if "M" is even and "sym" is True.
Parameters:
      M (int) -- the length of the window. In other words, the
      number of points of the returned window.
Keyword Arguments:
      * std (float, optional) -- the standard deviation of
        the gaussian. It controls how narrow or wide the window is.
        Default: 1.0.
  * **sym** (*bool**, **optional*) -- If *False*, returns a
    periodic window suitable for use in spectral analysis. If
    *True*, returns a symmetric window suitable for use in filter
    design. Default: *True*.


design. Default: True.
  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor. Default: if "None", uses a global default
    (see "torch.set_default_tensor_type()").

  * **layout** ("torch.layout", optional) -- the desired layout of
    returned Tensor. Default: "torch.strided".

  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if "None", uses the current device
    for the default tensor type (see
    "torch.set_default_tensor_type()"). "device" will be the CPU
    for CPU tensor types and the current CUDA device for CUDA
    tensor types.

  * **requires_grad** (*bool**, **optional*) -- If autograd should
    record operations on the returned tensor. Default: "False".

Return type:
      Tensor
Examples:
  >>> # Generates a symmetric gaussian window with a standard deviation of 1.0.
  >>> torch.signal.windows.gaussian(10)


torch.signal.windows.gaussian(10)
      tensor([4.0065e-05, 2.1875e-03, 4.3937e-02, 3.2465e-01, 8.8250e-01, 8.8250e-01, 3.2465e-01, 4.3937e-02, 2.1875e-03, 4.0065e-05])

  >>> # Generates a periodic gaussian window and standard deviation equal to 0.9.
  >>> torch.signal.windows.gaussian(10, sym=False,std=0.9)
  tensor([1.9858e-07, 5.1365e-05, 3.8659e-03, 8.4658e-02, 5.3941e-01, 1.0000e+00, 5.3941e-01, 8.4658e-02, 3.8659e-03, 5.1365e-05])


torch.Tensor.isposinf
Tensor.isposinf() -> Tensor
See "torch.isposinf()"


torch.Tensor.gather
Tensor.gather(dim, index) -> Tensor
See "torch.gather()"


torch.linalg.lu_factor
torch.linalg.lu_factor(A, *, bool pivot=True, out=None) -> (Tensor, Tensor)
Computes a compact representation of the LU factorization with
   partial pivoting of a matrix.
This function computes a compact representation of the
   decomposition given by "torch.linalg.lu()". If the matrix is
   square, this representation may be used in
   "torch.linalg.lu_solve()" to solve system of linear equations that
   share the matrix "A".
The returned decomposition is represented as a named tuple (LU,
   pivots). The "LU" matrix has the same shape as the input matrix
   "A". Its upper and lower triangular parts encode the non-constant
   elements of "L" and "U" of the LU decomposition of "A".
The returned permutation matrix is represented by a 1-indexed
   vector. pivots[i] == j represents that in the i-th step of the
   algorithm, the i-th row was permuted with the j-1-th row.
On CUDA, one may use "pivot"= False. In this case, this function


returns the LU decomposition without pivoting if it exists.
Supports inputs of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if the inputs are batches of
   matrices then the output has the same batch dimensions.
Note:
 When inputs are on a CUDA device, this function synchronizes that
 device with the CPU. For a version of this function that does not
 synchronize, see "torch.linalg.lu_factor_ex()".

Warning:
 The LU decomposition is almost never unique, as often there are
 different permutation matrices that can yield different LU
 decompositions. As such, different platforms, like SciPy, or
 inputs on different devices, may produce different valid
 decompositions.Gradient computations are only supported if the
 input matrix is full-rank. If this condition is not met, no error
 will be thrown, but the gradient may not be finite. This is
 because the LU decomposition with pivoting is not differentiable


at these points.
See also:
 "torch.linalg.lu_solve()" solves a system of linear equations
 given the output of this function provided the input matrix was
 square and invertible.

 "torch.lu_unpack()" unpacks the tensors returned by "lu_factor()"
 into the three matrices *P, L, U* that form the decomposition.

 "torch.linalg.lu()" computes the LU decomposition with partial
 pivoting of a possibly non-square matrix. It is a composition of
 "lu_factor()" and "torch.lu_unpack()".

 "torch.linalg.solve()" solves a system of linear equations. It is
 a composition of "lu_factor()" and "lu_solve()".

Parameters:
      A (Tensor) -- tensor of shape (, m, n)* where *** is
      zero or more batch dimensions.
Keyword Arguments:
      * pivot (bool, optional) -- Whether to compute the LU
        decomposition with partial pivoting, or the regular LU
        decomposition. "pivot"= False not supported on CPU. Default:
        True.


True.
  * **out** (*tuple**, **optional*) -- tuple of two tensors to
    write the output to. Ignored if *None*. Default: *None*.

Returns:
      A named tuple (LU, pivots).
Raises:
      RuntimeError -- if the "A" matrix is not invertible or any
      matrix in a batched "A"     is not invertible.
Examples:
  >>> A = torch.randn(2, 3, 3)
  >>> B1 = torch.randn(2, 3, 4)
  >>> B2 = torch.randn(2, 3, 7)
  >>> A_factor = torch.linalg.lu_factor(A)
  >>> X1 = torch.linalg.lu_solve(A_factor, B1)
  >>> X2 = torch.linalg.lu_solve(A_factor, B2)
  >>> torch.allclose(A @ X1, B1)
  True
  >>> torch.allclose(A @ X2, B2)
  True


torch.logical_not
torch.logical_not(input, *, out=None) -> Tensor
Computes the element-wise logical NOT of the given input tensor. If
   not specified, the output tensor will have the bool dtype. If the
   input tensor is not a bool tensor, zeros are treated as "False" and
   non-zeros are treated as "True".
Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> torch.logical_not(torch.tensor([True, False]))
  tensor([False,  True])
  >>> torch.logical_not(torch.tensor([0, 1, -10], dtype=torch.int8))
  tensor([ True, False, False])
  >>> torch.logical_not(torch.tensor([0., 1.5, -10.], dtype=torch.double))
  tensor([ True, False, False])
  >>> torch.logical_not(torch.tensor([0., 1., -10.], dtype=torch.double), out=torch.empty(3, dtype=torch.int16))
  tensor([1, 0, 0], dtype=torch.int16)


LazyConvTranspose3d
class torch.nn.LazyConvTranspose3d(out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1, padding_mode='zeros', device=None, dtype=None)
A "torch.nn.ConvTranspose3d" module with lazy initialization of the
   "in_channels" argument of the "ConvTranspose3d" that is inferred
   from the "input.size(1)". The attributes that will be lazily
   initialized are weight and bias.
Check the "torch.nn.modules.lazy.LazyModuleMixin" for further
   documentation on lazy modules and their limitations.
Parameters:
      * out_channels (int) -- Number of channels produced by the
        convolution
  * **kernel_size** (*int** or **tuple*) -- Size of the convolving
    kernel

  * **stride** (*int** or **tuple**, **optional*) -- Stride of the
    convolution. Default: 1

  * **padding** (*int** or **tuple**, **optional*) -- "dilation *
    (kernel_size - 1) - padding" zero-padding will be added to


both sides of each dimension in the input. Default: 0
  * **output_padding** (*int** or **tuple**, **optional*) --
    Additional size added to one side of each dimension in the
    output shape. Default: 0

  * **groups** (*int**, **optional*) -- Number of blocked
    connections from input channels to output channels. Default: 1

  * **bias** (*bool**, **optional*) -- If "True", adds a learnable
    bias to the output. Default: "True"

  * **dilation** (*int** or **tuple**, **optional*) -- Spacing
    between kernel elements. Default: 1

See also:
 "torch.nn.ConvTranspose3d" and
 "torch.nn.modules.lazy.LazyModuleMixin"

cls_to_become
  alias of "ConvTranspose3d"


torch.Tensor.logit
Tensor.logit() -> Tensor
See "torch.logit()"


torch.nn.functional.hardtanh_
torch.nn.functional.hardtanh_(input, min_val=- 1., max_val=1.) -> Tensor
In-place version of "hardtanh()".


torch.cuda.reset_max_memory_allocated
torch.cuda.reset_max_memory_allocated(device=None)
Resets the starting point in tracking maximum GPU memory occupied
   by tensors for a given device.
See "max_memory_allocated()" for details.
Parameters:
      device (torch.device or int, optional) -- selected
      device. Returns statistic for the current device, given by
      "current_device()", if "device" is "None" (default).
Warning:
 This function now calls "reset_peak_memory_stats()", which resets
 /all/ peak memory stats.

Note:
 See Memory management for more details about GPU memory
 management.


torch.Tensor.dense_dim
Tensor.dense_dim() -> int
Return the number of dense dimensions in a sparse tensor "self".
Note:
 Returns "len(self.shape)" if "self" is not a sparse tensor.

See also "Tensor.sparse_dim()" and hybrid tensors.


torch.Tensor.expm1_
Tensor.expm1_() -> Tensor
In-place version of "expm1()"


torch.cuda.initial_seed
torch.cuda.initial_seed()
Returns the current random seed of the current GPU.
Warning:
 This function eagerly initializes CUDA.

Return type:
      int


torch.Tensor.pow_
Tensor.pow_(exponent) -> Tensor
In-place version of "pow()"


PruningContainer
class torch.nn.utils.prune.PruningContainer(*args)
Container holding a sequence of pruning methods for iterative
   pruning. Keeps track of the order in which pruning methods are
   applied and handles combining successive pruning calls.
Accepts as argument an instance of a BasePruningMethod or an
   iterable of them.
add_pruning_method(method)
  Adds a child pruning "method" to the container.

  Parameters:
     **method** (*subclass of BasePruningMethod*) -- child pruning
     method to be added to the container.

classmethod apply(module, name, args, importance_scores=None, *kwargs)
  Adds the forward pre-hook that enables pruning on the fly and
  the reparametrization of a tensor in terms of the original
  tensor and the pruning mask.

  Parameters:
     * **module** (*nn.Module*) -- module containing the tensor to
       prune

     * **name** (*str*) -- parameter name within "module" on which


pruning will act.
     * **args** -- arguments passed on to a subclass of
       "BasePruningMethod"

     * **importance_scores** (*torch.Tensor*) -- tensor of
       importance scores (of same shape as module parameter) used
       to compute mask for pruning. The values in this tensor
       indicate the importance of the corresponding elements in
       the parameter being pruned. If unspecified or None, the
       parameter will be used in its place.

     * **kwargs** -- keyword arguments passed on to a subclass of
       a "BasePruningMethod"

apply_mask(module)
  Simply handles the multiplication between the parameter being
  pruned and the generated mask. Fetches the mask and the original
  tensor from the module and returns the pruned version of the
  tensor.

  Parameters:
     **module** (*nn.Module*) -- module containing the tensor to
     prune

  Returns:
     pruned version of the input tensor


pruned version of the input tensor
  Return type:
     pruned_tensor (torch.Tensor)

compute_mask(t, default_mask)
  Applies the latest "method" by computing the new partial masks
  and returning its combination with the "default_mask". The new
  partial mask should be computed on the entries or channels that
  were not zeroed out by the "default_mask". Which portions of the
  tensor "t" the new mask will be calculated from depends on the
  "PRUNING_TYPE" (handled by the type handler):

  * for 'unstructured', the mask will be computed from the raveled
    list of nonmasked entries;

  * for 'structured', the mask will be computed from the nonmasked
    channels in the tensor;

  * for 'global', the mask will be computed across all entries.

  Parameters:
     * **t** (*torch.Tensor*) -- tensor representing the parameter
       to prune (of same dimensions as "default_mask").


default_mask (torch.Tensor) -- mask from previous
           pruning iteration.
Returns:
     new mask that combines the effects of the "default_mask" and
     the new mask from the current pruning "method" (of same
     dimensions as "default_mask" and "t").
Return type:
     mask (torch.Tensor)

prune(t, default_mask=None, importance_scores=None)
  Computes and returns a pruned version of input tensor "t"
  according to the pruning rule specified in "compute_mask()".

  Parameters:
     * **t** (*torch.Tensor*) -- tensor to prune (of same
       dimensions as "default_mask").

     * **importance_scores** (*torch.Tensor*) -- tensor of
       importance scores (of same shape as "t") used to compute
       mask for pruning "t". The values in this tensor indicate
       the importance of the corresponding elements in the "t"
       that is being pruned. If unspecified or None, the tensor


"t" will be used in its place.
     * **default_mask** (*torch.Tensor**, **optional*) -- mask
       from previous pruning iteration, if any. To be considered
       when determining what portion of the tensor that pruning
       should act on. If None, default to a mask of ones.

  Returns:
     pruned version of tensor "t".

remove(module)
  Removes the pruning reparameterization from a module. The pruned
  parameter named "name" remains permanently pruned, and the
  parameter named "name+'_orig'" is removed from the parameter
  list. Similarly, the buffer named "name+'_mask'" is removed from
  the buffers.

  Note:

    Pruning itself is NOT undone or reversed!


torch.permute
torch.permute(input, dims) -> Tensor
Returns a view of the original tensor "input" with its dimensions
   permuted.
Parameters:
      * input (Tensor) -- the input tensor.
  * **dims** (*tuple of python:int*) -- The desired ordering of
    dimensions

-[ Example ]-

x = torch.randn(2, 3, 5)
x.size()
   torch.Size([2, 3, 5])
torch.permute(x, (2, 0, 1)).size()
   torch.Size([5, 2, 3])


torch.Tensor.le_
Tensor.le_(other) -> Tensor
In-place version of "le()".


torch.movedim
torch.movedim(input, source, destination) -> Tensor
Moves the dimension(s) of "input" at the position(s) in "source" to
   the position(s) in "destination".
Other dimensions of "input" that are not explicitly moved remain in
   their original order and appear at the positions not specified in
   "destination".
Parameters:
      * input (Tensor) -- the input tensor.
  * **source** (*int** or **tuple of ints*) -- Original positions
    of the dims to move. These must be unique.

  * **destination** (*int** or **tuple of ints*) -- Destination
    positions for each of the original dims. These must also be
    unique.

Examples:
  >>> t = torch.randn(3,2,1)
  >>> t
  tensor([[[-0.3362],
          [-0.8437]],

          [[-0.9627],
          [ 0.1727]],

          [[ 0.5173],
          [-0.1398]]])
  >>> torch.movedim(t, 1, 0).shape
  torch.Size([2, 3, 1])
  >>> torch.movedim(t, 1, 0)


torch.movedim(t, 1, 0)
      tensor([[[-0.3362],
              [-0.9627],
              [ 0.5173]],

          [[-0.8437],
          [ 0.1727],
          [-0.1398]]])
  >>> torch.movedim(t, (1, 2), (0, 1)).shape
  torch.Size([2, 1, 3])
  >>> torch.movedim(t, (1, 2), (0, 1))
  tensor([[[-0.3362, -0.9627,  0.5173]],

          [[-0.8437,  0.1727, -0.1398]]])


CustomFromMask
class torch.nn.utils.prune.CustomFromMask(mask)
classmethod apply(module, name, mask)
  Adds the forward pre-hook that enables pruning on the fly and
  the reparametrization of a tensor in terms of the original
  tensor and the pruning mask.

  Parameters:
     * **module** (*nn.Module*) -- module containing the tensor to
       prune

     * **name** (*str*) -- parameter name within "module" on which
       pruning will act.

apply_mask(module)
  Simply handles the multiplication between the parameter being
  pruned and the generated mask. Fetches the mask and the original
  tensor from the module and returns the pruned version of the
  tensor.

  Parameters:
     **module** (*nn.Module*) -- module containing the tensor to
     prune

  Returns:
     pruned version of the input tensor

  Return type:
     pruned_tensor (torch.Tensor)

prune(t, default_mask=None, importance_scores=None)


Computes and returns a pruned version of input tensor "t"
      according to the pruning rule specified in "compute_mask()".
  Parameters:
     * **t** (*torch.Tensor*) -- tensor to prune (of same
       dimensions as "default_mask").

     * **importance_scores** (*torch.Tensor*) -- tensor of
       importance scores (of same shape as "t") used to compute
       mask for pruning "t". The values in this tensor indicate
       the importance of the corresponding elements in the "t"
       that is being pruned. If unspecified or None, the tensor
       "t" will be used in its place.

     * **default_mask** (*torch.Tensor**, **optional*) -- mask
       from previous pruning iteration, if any. To be considered
       when determining what portion of the tensor that pruning
       should act on. If None, default to a mask of ones.

  Returns:
     pruned version of tensor "t".

remove(module)


remove(module)
  Removes the pruning reparameterization from a module. The pruned
  parameter named "name" remains permanently pruned, and the
  parameter named "name+'_orig'" is removed from the parameter
  list. Similarly, the buffer named "name+'_mask'" is removed from
  the buffers.

  Note:

    Pruning itself is NOT undone or reversed!


torch.foreach_expm1
torch.foreach_expm1(self: List[Tensor]) -> None
Apply "torch.expm1()" to each Tensor of the input list.


torch.Tensor.greater
Tensor.greater(other) -> Tensor
See "torch.greater()".


torch.linalg.eigvalsh
torch.linalg.eigvalsh(A, UPLO='L', *, out=None) -> Tensor
Computes the eigenvalues of a complex Hermitian or real symmetric
   matrix.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, the eigenvalues
   of a complex Hermitian or real symmetric  matrix A \in
   \mathbb{K}^{n \times n} are defined as the roots (counted with
   multiplicity) of the polynomial p of degree n given by
  p(\lambda) = \operatorname{det}(A - \lambda
  \mathrm{I}_n)\mathrlap{\qquad \lambda \in \mathbb{R}}

where \mathrm{I}_n is the n-dimensional identity matrix. The
   eigenvalues of a real symmetric or complex Hermitian matrix are
   always real.
Supports input of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if "A" is a batch of matrices
   then the output has the same batch dimensions.
The eigenvalues are returned in ascending order.
"A" is assumed to be Hermitian (resp. symmetric), but this is not


checked internally, instead:

If "UPLO"= 'L' (default), only the lower triangular part of the
     matrix is used in the computation.

If "UPLO"= 'U', only the upper triangular part of the matrix is
     used.

Note:
 When inputs are on a CUDA device, this function synchronizes that
 device with the CPU.

See also:
 "torch.linalg.eigh()" computes the full eigenvalue decomposition.

Parameters:
      * A (Tensor) -- tensor of shape (, n, n)* where *** is
        zero or more batch dimensions consisting of symmetric or
        Hermitian matrices.
  * **UPLO** (*'L'**, **'U'**, **optional*) -- controls whether to
    use the upper or lower triangular part of "A" in the
    computations. Default: *'L'*.

Keyword Arguments:
      out (Tensor, optional) -- output tensor. Ignored if
      None. Default: None.
Returns:
      A real-valued tensor containing the eigenvalues even when "A" is


complex. The eigenvalues are returned in ascending order.
Examples:
  >>> A = torch.randn(2, 2, dtype=torch.complex128)
  >>> A = A + A.T.conj()  # creates a Hermitian matrix
  >>> A
  tensor([[2.9228+0.0000j, 0.2029-0.0862j],
          [0.2029+0.0862j, 0.3464+0.0000j]], dtype=torch.complex128)
  >>> torch.linalg.eigvalsh(A)
  tensor([0.3277, 2.9415], dtype=torch.float64)

  >>> A = torch.randn(3, 2, 2, dtype=torch.float64)
  >>> A = A + A.mT  # creates a batch of symmetric matrices
  >>> torch.linalg.eigvalsh(A)
  tensor([[ 2.5797,  3.4629],
          [-4.1605,  1.3780],
          [-3.1113,  2.7381]], dtype=torch.float64)


torch.nn.functional.adaptive_max_pool3d
torch.nn.functional.adaptive_max_pool3d(args, *kwargs)
Applies a 3D adaptive max pooling over an input signal composed of
   several input planes.
See "AdaptiveMaxPool3d" for details and output shape.
Parameters:
      * output_size -- the target output size (single integer or
        triple-integer tuple)
  * **return_indices** -- whether to return pooling indices.
    Default: "False"


torch.mv
torch.mv(input, vec, *, out=None) -> Tensor
Performs a matrix-vector product of the matrix "input" and the
   vector "vec".
If "input" is a (n \times m) tensor, "vec" is a 1-D tensor of size
   m, "out" will be 1-D of size n.
Note:
 This function does not broadcast.

Parameters:
      * input (Tensor) -- matrix to be multiplied
  * **vec** (*Tensor*) -- vector to be multiplied

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> mat = torch.randn(2, 3)
  >>> vec = torch.randn(3)
  >>> torch.mv(mat, vec)
  tensor([ 1.0404, -0.6361])


torch.Tensor.median
Tensor.median(dim=None, keepdim=False)
See "torch.median()"


default_qat_qconfig
torch.quantization.qconfig.default_qat_qconfig
alias of QConfig(activation=functools.partial(,
   observer=,
   quant_min=0, quant_max=255, dtype=torch.quint8,
   qscheme=torch.per_tensor_affine, reduce_range=True){},
   weight=functools.partial(,
   observer=,
   quant_min=-128, quant_max=127, dtype=torch.qint8,
   qscheme=torch.per_tensor_symmetric, reduce_range=False){})


torch.Tensor.set_
Tensor.set_(source=None, storage_offset=0, size=None, stride=None) -> Tensor
Sets the underlying storage, size, and strides. If "source" is a
   tensor, "self" tensor will share the same storage and have the same
   size and strides as "source". Changes to elements in one tensor
   will be reflected in the other.
If "source" is a "Storage", the method sets the underlying storage,
   offset, size, and stride.
Parameters:
      * source (Tensor or Storage) -- the tensor or storage
        to use
  * **storage_offset** (*int**, **optional*) -- the offset in the
    storage

  * **size** (*torch.Size**, **optional*) -- the desired size.
    Defaults to the size of the source.

  * **stride** (*tuple**, **optional*) -- the desired stride.
    Defaults to C-contiguous strides.


torch.amax
torch.amax(input, dim, keepdim=False, *, out=None) -> Tensor
Returns the maximum value of each slice of the "input" tensor in
   the given dimension(s) "dim".
Note:
 The difference between "max"/"min" and "amax"/"amin" is:
    * "amax"/"amin" supports reducing on multiple dimensions,

    * "amax"/"amin" does not return indices,

    * "amax"/"amin" evenly distributes gradient between equal
      values, while "max(dim)"/"min(dim)" propagates gradient only
      to a single index in the source tensor.

If "keepdim" is "True", the output tensor is of the same size as
   "input" except in the dimension(s) "dim" where it is of size 1.
   Otherwise, "dim" is squeezed (see "torch.squeeze()"), resulting in
   the output tensor having 1 (or "len(dim)") fewer dimension(s).
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int** or **tuple of ints*) -- the dimension or
    dimensions to reduce.


dimensions to reduce.
  * **keepdim** (*bool*) -- whether the output tensor has "dim"
    retained or not.

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[ 0.8177,  1.4878, -0.2491,  0.9130],
          [-0.7158,  1.1775,  2.0992,  0.4817],
          [-0.0053,  0.0164, -1.3738, -0.0507],
          [ 1.9700,  1.1106, -1.0318, -1.0816]])
  >>> torch.amax(a, 1)
  tensor([1.4878, 2.0992, 0.0164, 1.9700])


torch.cuda.manual_seed
torch.cuda.manual_seed(seed)
Sets the seed for generating random numbers for the current GPU.
   It's safe to call this function if CUDA is not available; in that
   case, it is silently ignored.
Parameters:
      seed (int) -- The desired seed.
Warning:
 If you are working with a multi-GPU model, this function is
 insufficient to get determinism.  To seed all GPUs, use
 "manual_seed_all()".


torch.lobpcg
torch.lobpcg(A, k=None, B=None, X=None, n=None, iK=None, niter=None, tol=None, largest=None, method=None, tracker=None, ortho_iparams=None, ortho_fparams=None, ortho_bparams=None)
Find the k largest (or smallest) eigenvalues and the corresponding
   eigenvectors of a symmetric positive definite generalized
   eigenvalue problem using matrix-free LOBPCG methods.
This function is a front-end to the following LOBPCG algorithms
   selectable via method argument:
  *method="basic"* - the LOBPCG method introduced by Andrew
  Knyazev, see [Knyazev2001]. A less robust method, may fail when
  Cholesky is applied to singular input.

  *method="ortho"* - the LOBPCG method with orthogonal basis
  selection [StathopoulosEtal2002]. A robust method.

Supported inputs are dense, sparse, and batches of dense matrices.
Note:
 In general, the basic method spends least time per iteration.
 However, the robust methods converge much faster and are more


stable. So, the usage of the basic method is generally not
     recommended but there exist cases where the usage of the basic
     method may be preferred.
Warning:
 The backward method does not support sparse and complex inputs.
 It works only when *B* is not provided (i.e. *B == None*). We are
 actively working on extensions, and the details of the algorithms
 are going to be published promptly.

Warning:
 While it is assumed that *A* is symmetric, *A.grad* is not. To
 make sure that *A.grad* is symmetric, so that *A - t * A.grad* is
 symmetric in first-order optimization routines, prior to running
 *lobpcg* we do the following symmetrization map: *A -> (A +
 A.t()) / 2*. The map is performed only when the *A* requires
 gradients.

Parameters:
      * A (Tensor) -- the input tensor of size (*, m, m)
  * **B** (*Tensor**, **optional*) -- the input tensor of size (*,
    m, m). When not specified, *B* is interpreted as identity


matrix.
  * **X** (*tensor**, **optional*) -- the input tensor of size (*,
    m, n) where *k <= n <= m*. When specified, it is used as
    initial approximation of eigenvectors. X must be a dense
    tensor.

  * **iK** (*tensor**, **optional*) -- the input tensor of size
    (*, m, m). When specified, it will be used as preconditioner.

  * **k** (*integer**, **optional*) -- the number of requested
    eigenpairs. Default is the number of X columns (when
    specified) or *1*.

  * **n** (*integer**, **optional*) -- if X is not specified then
    *n* specifies the size of the generated random approximation
    of eigenvectors. Default value for *n* is *k*. If X is
    specified, the value of *n* (when specified) must be the
    number of X columns.

  * **tol** (*float**, **optional*) -- residual tolerance for
    stopping criterion. Default is *feps ** 0.5* where *feps* is


smallest non-zero floating-point number of the given input
        tensor A data type.
  * **largest** (*bool**, **optional*) -- when True, solve the
    eigenproblem for the largest eigenvalues. Otherwise, solve the
    eigenproblem for smallest eigenvalues. Default is *True*.

  * **method** (*str**, **optional*) -- select LOBPCG method. See
    the description of the function above. Default is "ortho".

  * **niter** (*int**, **optional*) -- maximum number of
    iterations. When reached, the iteration process is hard-
    stopped and the current approximation of eigenpairs is
    returned. For infinite iteration but until convergence
    criteria is met, use *-1*.

  * **tracker** (*callable**, **optional*) --

    a function for tracing the iteration process. When specified,
    it is called at each iteration step with LOBPCG instance as an
    argument. The LOBPCG instance holds the full state of the