device with the CPU.
Warning:
 This function assumes that "A" is diagonalizable (for example,
 when all the eigenvalues are different). If it is not
 diagonalizable, the returned eigenvalues will be correct but A
 \neq V \operatorname{diag}(\Lambda)V^{-1}.

Warning:
 The returned eigenvectors are normalized to have norm *1*. Even
 then, the eigenvectors of a matrix are not unique, nor are they
 continuous with respect to "A". Due to this lack of uniqueness,
 different hardware and software may compute different
 eigenvectors.This non-uniqueness is caused by the fact that
 multiplying an eigenvector by by e^{i \phi}, \phi \in \mathbb{R}
 produces another set of valid eigenvectors of the matrix.  For
 this reason, the loss function shall not depend on the phase of
 the eigenvectors, as this quantity is not well-defined. This is
 checked when computing the gradients of this function. As such,


when inputs are on a CUDA device, this function synchronizes that
     device with the CPU when computing the gradients. This is checked
     when computing the gradients of this function. As such, when
     inputs are on a CUDA device, the computation of the gradients of
     this function synchronizes that device with the CPU.
Warning:
 Gradients computed using the *eigenvectors* tensor will only be
 finite when "A" has distinct eigenvalues. Furthermore, if the
 distance between any two eigenvalues is close to zero, the
 gradient will be numerically unstable, as it depends on the
 eigenvalues \lambda_i through the computation of \frac{1}{\min_{i
 \neq j} \lambda_i - \lambda_j}.

See also:
 "torch.linalg.eigvals()" computes only the eigenvalues. Unlike
 "torch.linalg.eig()", the gradients of "eigvals()" are always
 numerically stable.

 "torch.linalg.eigh()" for a (faster) function that computes the


eigenvalue decomposition for Hermitian and symmetric matrices.
 "torch.linalg.svd()" for a function that computes another type of
 spectral decomposition that works on matrices of any shape.

 "torch.linalg.qr()" for another (much faster) decomposition that
 works on matrices of any shape.

Parameters:
      A (Tensor) -- tensor of shape (, n, n)* where *** is
      zero or more batch dimensions consisting of diagonalizable
      matrices.
Keyword Arguments:
      out (tuple, optional) -- output tuple of two tensors.
      Ignored if None. Default: None.
Returns:
      A named tuple (eigenvalues, eigenvectors) which corresponds to
      \Lambda and V above.
  *eigenvalues* and *eigenvectors* will always be complex-valued,
  even when "A" is real. The eigenvectors will be given by the
  columns of *eigenvectors*.

Examples:
  >>> A = torch.randn(2, 2, dtype=torch.complex128)
  >>> A


A
      tensor([[ 0.9828+0.3889j, -0.4617+0.3010j],
              [ 0.1662-0.7435j, -0.6139+0.0562j]], dtype=torch.complex128)
      >>> L, V = torch.linalg.eig(A)
      >>> L
      tensor([ 1.1226+0.5738j, -0.7537-0.1286j], dtype=torch.complex128)
      >>> V
      tensor([[ 0.9218+0.0000j,  0.1882-0.2220j],
              [-0.0270-0.3867j,  0.9567+0.0000j]], dtype=torch.complex128)
      >>> torch.dist(V @ torch.diag(L) @ torch.linalg.inv(V), A)
      tensor(7.7119e-16, dtype=torch.float64)

  >>> A = torch.randn(3, 2, 2, dtype=torch.float64)
  >>> L, V = torch.linalg.eig(A)
  >>> torch.dist(V @ torch.diag_embed(L) @ torch.linalg.inv(V), A)
  tensor(3.2841e-16, dtype=torch.float64)


torch.nn.functional.hinge_embedding_loss
torch.nn.functional.hinge_embedding_loss(input, target, margin=1.0, size_average=None, reduce=None, reduction='mean') -> Tensor
See "HingeEmbeddingLoss" for details.
Return type:
      Tensor


DataParallel
class torch.nn.DataParallel(module, device_ids=None, output_device=None, dim=0)
Implements data parallelism at the module level.
This container parallelizes the application of the given "module"
   by splitting the input across the specified devices by chunking in
   the batch dimension (other objects will be copied once per device).
   In the forward pass, the module is replicated on each device, and
   each replica handles a portion of the input. During the backwards
   pass, gradients from each replica are summed into the original
   module.
The batch size should be larger than the number of GPUs used.
Warning:
 It is recommended to use "DistributedDataParallel", instead of
 this class, to do multi-GPU training, even if there is only a
 single node. See: Use nn.parallel.DistributedDataParallel instead
 of multiprocessing or nn.DataParallel and Distributed Data
 Parallel.

Arbitrary positional and keyword inputs are allowed to be passed


into DataParallel but some types are specially handled. tensors
   will be scattered on dim specified (default 0). tuple, list and
   dict types will be shallow copied. The other types will be shared
   among different threads and can be corrupted if written to in the
   model's forward pass.
The parallelized "module" must have its parameters and buffers on
   "device_ids[0]" before running this "DataParallel" module.
Warning:
 In each forward, "module" is **replicated** on each device, so
 any updates to the running module in "forward" will be lost. For
 example, if "module" has a counter attribute that is incremented
 in each "forward", it will always stay at the initial value
 because the update is done on the replicas which are destroyed
 after "forward". However, "DataParallel" guarantees that the
 replica on "device[0]" will have its parameters and buffers
 sharing storage with the base parallelized "module". So **in-


place** updates to the parameters or buffers on "device[0]" will
     be recorded. E.g., "BatchNorm2d" and "spectral_norm()" rely on
     this behavior to update the buffers.
Warning:
 Forward and backward hooks defined on "module" and its submodules
 will be invoked "len(device_ids)" times, each with inputs located
 on a particular device. Particularly, the hooks are only
 guaranteed to be executed in correct order with respect to
 operations on corresponding devices. For example, it is not
 guaranteed that hooks set via "register_forward_pre_hook()" be
 executed before *all* "len(device_ids)" "forward()" calls, but
 that each such hook be executed before the corresponding
 "forward()" call of that device.

Warning:
 When "module" returns a scalar (i.e., 0-dimensional tensor) in
 "forward()", this wrapper will return a vector of length equal to
 number of devices used in data parallelism, containing the result
 from each device.

Note:


from each device.
Note:
 There is a subtlety in using the "pack sequence -> recurrent
 network -> unpack sequence" pattern in a "Module" wrapped in
 "DataParallel". See My recurrent network doesn't work with data
 parallelism section in FAQ for details.

Parameters:
      * module (Module) -- module to be parallelized
  * **device_ids** (*list of python:int** or **torch.device*) --
    CUDA devices (default: all devices)

  * **output_device** (*int** or **torch.device*) -- device
    location of output (default: device_ids[0])

Variables:
      module (Module) -- the module to be parallelized
Example:
  >>> net = torch.nn.DataParallel(model, device_ids=[0, 1, 2])
  >>> output = net(input_var)  # input_var can be on any device, including CPU


GLU
class torch.nn.GLU(dim=- 1)
Applies the gated linear unit function {GLU}(a, b)= a \otimes
   \sigma(b) where a is the first half of the input matrices and b is
   the second half.
Parameters:
      dim (int) -- the dimension on which to split the input.
      Default: -1
Shape:
      * Input: (\ast_1, N, \ast_2) where *** means, any number of
        additional dimensions
  * Output: (\ast_1, M, \ast_2) where M=N/2

Examples:
  >>> m = nn.GLU()
  >>> input = torch.randn(4, 2)
  >>> output = m(input)


torch.Tensor.diagflat
Tensor.diagflat(offset=0) -> Tensor
See "torch.diagflat()"


ReflectionPad1d
class torch.nn.ReflectionPad1d(padding)
Pads the input tensor using the reflection 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.ReflectionPad1d(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([[[2., 1., 0., 1., 2., 3., 2., 1.],
           [6., 5., 4., 5., 6., 7., 6., 5.]]])
  >>> # using different paddings for different sides


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


conv1d
class torch.ao.nn.quantized.functional.conv1d(input, weight, bias, stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', scale=1.0, zero_point=0, dtype=torch.quint8)
Applies a 1D convolution over a quantized 1D input composed of
   several input planes.
See "Conv1d" for details and output shape.
Parameters:
      * input -- quantized input tensor of shape (\text{minibatch}
        , \text{in_channels} , iW)
  * **weight** -- quantized filters of shape (\text{out\_channels}
    , \frac{\text{in\_channels}}{\text{groups}} , iW)

  * **bias** -- **non-quantized** bias tensor of shape
    (\text{out\_channels}). The tensor type must be *torch.float*.

  * **stride** -- the stride of the convolving kernel. Can be a
    single number or a tuple *(sW,)*. Default: 1

  * **padding** -- implicit paddings on both sides of the input.
    Can be a single number or a tuple *(padW,)*. Default: 0


dilation -- the spacing between kernel elements. Can be a
        single number or a tuple (dW,). Default: 1

groups -- split input into groups, \text{in_channels}
    should be divisible by the number of groups. Default: 1

padding_mode -- the padding mode to use. Only "zeros" is
    supported for quantized convolution at the moment. Default:
    "zeros"

scale -- quantization scale for the output. Default: 1.0

zero_point -- quantization zero_point for the output.
    Default: 0

dtype -- quantization data type to use. Default:
    "torch.quint8"

Examples:
  >>> from torch.ao.nn.quantized import functional as qF
  >>> filters = torch.randn(33, 16, 3, dtype=torch.float)
  >>> inputs = torch.randn(20, 16, 50, dtype=torch.float)
  >>> bias = torch.randn(33, dtype=torch.float)
  >>>
  >>> scale, zero_point = 1.0, 0
  >>> dtype_inputs = torch.quint8


dtype_inputs = torch.quint8
      >>> dtype_filters = torch.qint8
      >>>
      >>> q_filters = torch.quantize_per_tensor(filters, scale, zero_point, dtype_filters)
      >>> q_inputs = torch.quantize_per_tensor(inputs, scale, zero_point, dtype_inputs)
      >>> qF.conv1d(q_inputs, q_filters, bias, padding=1, scale=scale, zero_point=zero_point)


conv2d
class torch.ao.nn.quantized.functional.conv2d(input, weight, bias, stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', scale=1.0, zero_point=0, dtype=torch.quint8)
Applies a 2D convolution over a quantized 2D input composed of
   several input planes.
See "Conv2d" for details and output shape.
Parameters:
      * input -- quantized input tensor of shape (\text{minibatch}
        , \text{in_channels} , iH , iW)
  * **weight** -- quantized filters of shape (\text{out\_channels}
    , \frac{\text{in\_channels}}{\text{groups}} , kH , kW)

  * **bias** -- **non-quantized** bias tensor of shape
    (\text{out\_channels}). The tensor type must be *torch.float*.

  * **stride** -- the stride of the convolving kernel. Can be a
    single number or a tuple *(sH, sW)*. Default: 1

  * **padding** -- implicit paddings on both sides of the input.
    Can be a single number or a tuple *(padH, padW)*. Default: 0


dilation -- the spacing between kernel elements. Can be a
        single number or a tuple (dH, dW). Default: 1

groups -- split input into groups, \text{in_channels}
    should be divisible by the number of groups. Default: 1

padding_mode -- the padding mode to use. Only "zeros" is
    supported for quantized convolution at the moment. Default:
    "zeros"

scale -- quantization scale for the output. Default: 1.0

zero_point -- quantization zero_point for the output.
    Default: 0

dtype -- quantization data type to use. Default:
    "torch.quint8"

Examples:
  >>> from torch.ao.nn.quantized import functional as qF
  >>> filters = torch.randn(8, 4, 3, 3, dtype=torch.float)
  >>> inputs = torch.randn(1, 4, 5, 5, dtype=torch.float)
  >>> bias = torch.randn(8, dtype=torch.float)
  >>>
  >>> scale, zero_point = 1.0, 0
  >>> dtype_inputs = torch.quint8


dtype_inputs = torch.quint8
      >>> dtype_filters = torch.qint8
      >>>
      >>> q_filters = torch.quantize_per_tensor(filters, scale, zero_point, dtype_filters)
      >>> q_inputs = torch.quantize_per_tensor(inputs, scale, zero_point, dtype_inputs)
      >>> qF.conv2d(q_inputs, q_filters, bias, padding=1, scale=scale, zero_point=zero_point)


torch.Tensor.exp_
Tensor.exp_() -> Tensor
In-place version of "exp()"


torch.manual_seed
torch.manual_seed(seed)
Sets the seed for generating random numbers. Returns a
   torch.Generator object.
Parameters:
      seed (int) -- The desired seed. Value must be within the
      inclusive range [-0x8000_0000_0000_0000,
      0xffff_ffff_ffff_ffff]. Otherwise, a RuntimeError is raised.
      Negative inputs are remapped to positive values with the formula
      0xffff_ffff_ffff_ffff + seed.
Return type:
      Generator


torch.Tensor.register_hook
Tensor.register_hook(hook)
Registers a backward hook.
The hook will be called every time a gradient with respect to the
   Tensor is computed. The hook should have the following signature:
  hook(grad) -> Tensor or None

The hook should not modify its argument, but it can optionally
   return a new gradient which will be used in place of "grad".
This function returns a handle with a method "handle.remove()" that
   removes the hook from the module.
Note:
 See Backward Hooks execution for more information on how when
 this hook is executed, and how its execution is ordered relative
 to other hooks.

Example:
  >>> v = torch.tensor([0., 0., 0.], requires_grad=True)
  >>> h = v.register_hook(lambda grad: grad * 2)  # double the gradient
  >>> v.backward(torch.tensor([1., 2., 3.]))
  >>> v.grad

   2
   4
   6
  [torch.FloatTensor of size (3,)]

  >>> h.remove()  # removes the hook


torch.index_copy
torch.index_copy(input, dim, index, source, *, out=None) -> Tensor
See "index_add_()" for function description.


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


torch.set_warn_always
torch.set_warn_always(b)
When this flag is False (default) then some PyTorch warnings may
   only appear once per process. This helps avoid excessive warning
   information. Setting it to True causes these warnings to always
   appear, which may be helpful when debugging.
Parameters:
      b ("bool") -- If True, force warnings to always be emitted
      If False, set to the default behaviour


torch.nn.functional.pixel_unshuffle
torch.nn.functional.pixel_unshuffle(input, downscale_factor) -> Tensor
Reverses the "PixelShuffle" operation by rearranging elements in a
   tensor of shape (, C, H \times r, W \times r) to a tensor of shape
   (, C \times r^2, H, W), where r is the "downscale_factor".
See "PixelUnshuffle" for details.
Parameters:
      * input (Tensor) -- the input tensor
  * **downscale_factor** (*int*) -- factor to increase spatial
    resolution by

Examples:
  >>> input = torch.randn(1, 1, 12, 12)
  >>> output = torch.nn.functional.pixel_unshuffle(input, 3)
  >>> print(output.size())
  torch.Size([1, 9, 4, 4])


torch.nn.functional.sigmoid
torch.nn.functional.sigmoid(input) -> Tensor
Applies the element-wise function \text{Sigmoid}(x) = \frac{1}{1 +
   \exp(-x)}
See "Sigmoid" for more details.


Conv2d
class torch.ao.nn.quantized.Conv2d(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 2D convolution over a quantized input signal composed of
   several quantized input planes.
For details on input arguments, parameters, and implementation see
   "Conv2d".
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 "Conv2d" for other attributes.
Examples:
  >>> # With square kernels and equal stride
  >>> m = nn.quantized.Conv2d(16, 33, 3, stride=2)
  >>> # non-square kernels and unequal stride and with padding


m = nn.quantized.Conv2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
      >>> # non-square kernels and unequal stride and with padding and dilation
      >>> m = nn.quantized.Conv2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2), dilation=(3, 1))
      >>> input = torch.randn(20, 16, 50, 100)
      >>> # 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


torch.bitwise_or
torch.bitwise_or(input, other, *, out=None) -> Tensor
Computes the bitwise OR of "input" and "other". The input tensor
   must be of integral or Boolean types. For bool tensors, it computes
   the logical OR.
Parameters:
      * input -- the first input tensor
  * **other** -- the second input tensor

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


torch.unsqueeze
torch.unsqueeze(input, dim) -> Tensor
Returns a new tensor with a dimension of size one inserted at the
   specified position.
The returned tensor shares the same underlying data with this
   tensor.
A "dim" value within the range "[-input.dim() - 1, input.dim() +
   1)" can be used. Negative "dim" will correspond to "unsqueeze()"
   applied at "dim" = "dim + input.dim() + 1".
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the index at which to insert the singleton
    dimension

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


torch.set_num_threads
torch.set_num_threads(int)
Sets the number of threads used for intraop parallelism on CPU.
Warning:
 To ensure that the correct number of threads is used,
 set_num_threads must be called before running eager, JIT or
 autograd code.


torch.square
torch.square(input, *, out=None) -> Tensor
Returns a new tensor with the square of the elements of "input".
Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4)
  >>> a
  tensor([-2.0755,  1.0226,  0.0831,  0.4806])
  >>> torch.square(a)
  tensor([ 4.3077,  1.0457,  0.0069,  0.2310])


torch.Tensor.double
Tensor.double(memory_format=torch.preserve_format) -> Tensor
"self.double()" is equivalent to "self.to(torch.float64)". See
   "to()".
Parameters:
      memory_format ("torch.memory_format", optional) -- the
      desired memory format of returned Tensor. Default:
      "torch.preserve_format".


torch.Tensor.i0_
Tensor.i0_() -> Tensor
In-place version of "i0()"


torch.all
torch.all(input) -> Tensor
Tests if all elements in "input" evaluate to True.
Note:
 This function matches the behaviour of NumPy in returning output
 of dtype *bool* for all supported dtypes except *uint8*. For
 *uint8* the dtype of output is *uint8* itself.

Example:
  >>> a = torch.rand(1, 2).bool()
  >>> a
  tensor([[False, True]], dtype=torch.bool)
  >>> torch.all(a)
  tensor(False, dtype=torch.bool)
  >>> a = torch.arange(0, 3)
  >>> a
  tensor([0, 1, 2])
  >>> torch.all(a)
  tensor(False)

torch.all(input, dim, keepdim=False, *, out=None) -> Tensor
For each row of "input" in the given dimension "dim", returns
   True if all elements in the row evaluate to True and False
   otherwise.
If "keepdim" is "True", the output tensor is of the same size as
   "input" except in the dimension "dim" where it is of size 1.
   Otherwise, "dim" is squeezed (see "torch.squeeze()"), resulting in


the output tensor having 1 fewer dimension than "input".
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the dimension to reduce.

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

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.rand(4, 2).bool()
  >>> a
  tensor([[True, True],
          [True, False],
          [True, True],
          [True, True]], dtype=torch.bool)
  >>> torch.all(a, dim=1)
  tensor([ True, False,  True,  True], dtype=torch.bool)
  >>> torch.all(a, dim=0)
  tensor([ True, False], dtype=torch.bool)


torch.Tensor.prod
Tensor.prod(dim=None, keepdim=False, dtype=None) -> Tensor
See "torch.prod()"


torch.lu_solve
torch.lu_solve(b, LU_data, LU_pivots, *, out=None) -> Tensor
Returns the LU solve of the linear system Ax = b using the
   partially pivoted LU factorization of A from "lu_factor()".
This function supports "float", "double", "cfloat" and "cdouble"
   dtypes for "input".
Warning:
 "torch.lu_solve()" is deprecated in favor of
 "torch.linalg.lu_solve()". "torch.lu_solve()" will be removed in
 a future PyTorch release. "X = torch.lu_solve(B, LU, pivots)"
 should be replaced with

    X = linalg.lu_solve(LU, pivots, B)

Parameters:
      * b (Tensor) -- the RHS tensor of size (*, m, k), where *
        is zero or more batch dimensions.
  * **LU_data** (*Tensor*) -- the pivoted LU factorization of A
    from "lu_factor()" of size (*, m, m), where * is zero or more
    batch dimensions.

  * **LU_pivots** (*IntTensor*) -- the pivots of the LU
    factorization from "lu_factor()" of size (*, m), where * is


zero or more batch dimensions. The batch dimensions of
        "LU_pivots" must be equal to the batch dimensions of
        "LU_data".
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> A = torch.randn(2, 3, 3)
  >>> b = torch.randn(2, 3, 1)
  >>> LU, pivots = torch.linalg.lu_factor(A)
  >>> x = torch.lu_solve(b, LU, pivots)
  >>> torch.dist(A @ x, b)
  tensor(1.00000e-07 *
         2.8312)


torch.cuda.comm.broadcast
torch.cuda.comm.broadcast(tensor, devices=None, *, out=None)
Broadcasts a tensor to specified GPU devices.
Parameters:
      * tensor (Tensor) -- tensor to broadcast. Can be on CPU or
        GPU.
  * **devices** (*Iterable**[**torch.device**, **str** or
    **int**]**, **optional*) -- an iterable of GPU devices, among
    which to broadcast.

  * **out** (*Sequence**[**Tensor**]**, **optional**, **keyword-
    only*) -- the GPU tensors to store output results.

Note:
 Exactly one of "devices" and "out" must be specified.

Returns:
      * If "devices" is specified,
           a tuple containing copies of "tensor", placed on "devices".
  * If "out" is specified,
       a tuple containing "out" tensors, each containing a copy of
       "tensor".


torch.Tensor.item
Tensor.item() -> number
Returns the value of this tensor as a standard Python number. This
   only works for tensors with one element. For other cases, see
   "tolist()".
This operation is not differentiable.
Example:
  >>> x = torch.tensor([1.0])
  >>> x.item()
  1.0


torch.fmod
torch.fmod(input, other, *, out=None) -> Tensor
Applies C++'s std::fmod entrywise. The result has the same sign as
   the dividend "input" and its absolute value is less than that of
   "other".
This function may be defined in terms of "torch.div()" as
  torch.fmod(a, b) == a - a.div(b, rounding_mode="trunc") * b

Supports broadcasting to a common shape, type promotion, and
   integer and float inputs.
Note:
 When the divisor is zero, returns "NaN" for floating point dtypes
 on both CPU and GPU; raises "RuntimeError" for integer division
 by zero on CPU; Integer division by zero on GPU may return any
 value.

Note:
 Complex inputs are not supported. In some cases, it is not
 mathematically possible to satisfy the definition of a modulo
 operation with complex numbers.

See also:
 "torch.remainder()" which implements Python's modulus operator.
 This one is defined using division rounding down the result.

Parameters:


Parameters:
      * input (Tensor) -- the dividend
  * **other** (*Tensor** or **Scalar*) -- the divisor

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> torch.fmod(torch.tensor([-3., -2, -1, 1, 2, 3]), 2)
  tensor([-1., -0., -1.,  1.,  0.,  1.])
  >>> torch.fmod(torch.tensor([1, 2, 3, 4, 5]), -1.5)
  tensor([1.0000, 0.5000, 0.0000, 1.0000, 0.5000])


torch.argmin
torch.argmin(input, dim=None, keepdim=False) -> LongTensor
Returns the indices of the minimum value(s) of the flattened tensor
   or along a dimension
This is the second value returned by "torch.min()". See its
   documentation for the exact semantics of this method.
Note:
 If there are multiple minimal values then the indices of the
 first minimal value are returned.

Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the dimension to reduce. If "None", the
    argmin of the flattened input is returned.

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

Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[ 0.1139,  0.2254, -0.1381,  0.3687],
          [ 1.0100, -1.1975, -0.0102, -0.4732],
          [-0.9240,  0.1207, -0.7506, -1.0213],
          [ 1.7809, -1.2960,  0.9384,  0.1438]])
  >>> torch.argmin(a)
  tensor(13)


torch.argmin(a)
      tensor(13)
      >>> torch.argmin(a, dim=1)
      tensor([ 2,  1,  3,  1])
      >>> torch.argmin(a, dim=1, keepdim=True)
      tensor([[2],
              [1],
              [3],
              [1]])


torch.Tensor.type_as
Tensor.type_as(tensor) -> Tensor
Returns this tensor cast to the type of the given tensor.
This is a no-op if the tensor is already of the correct type. This
   is equivalent to "self.type(tensor.type())"
Parameters:
      tensor (Tensor) -- the tensor which has the desired type


Conv1d
class torch.nn.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 an input signal composed of several
   input planes.
In the simplest case, the output value of the layer with input size
   (N, C_{\text{in}}, L) and output (N, C_{\text{out}},
   L_{\text{out}}) can be precisely described as:
  \text{out}(N_i, C_{\text{out}_j}) =
  \text{bias}(C_{\text{out}_j}) + \sum_{k = 0}^{C_{in} - 1}
  \text{weight}(C_{\text{out}_j}, k) \star \text{input}(N_i, k)

where \star is the valid cross-correlation operator, N is a batch
   size, C denotes a number of channels, L is a length of signal
   sequence.
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, a single


number or a one-element tuple.

"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


with its own set of filters (of size
          \frac{\text{out_channels}}{\text{in_channels}}).
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:


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 both 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}, L_{in}) or (C_{in}, L_{in})
  * Output: (N, C_{out}, L_{out}) or (C_{out}, L_{out}), where

       L_{out} = \left\lfloor\frac{L_{in} + 2 \times
       \text{padding} - \text{dilation}           \times
       (\text{kernel\_size} - 1) - 1}{\text{stride}} +
       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}). The values of these weights are sampled
        from \mathcal{U}(-\sqrt{k}, \sqrt{k}) where k =
        \frac{groups}{C_\text{in} * \text{kernel_size}}


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} *
        \text{kernel_size}}

Examples:
  >>> m = nn.Conv1d(16, 33, 3, stride=2)
  >>> input = torch.randn(20, 16, 50)
  >>> output = m(input)


JitScalarType
class torch.onnx.JitScalarType(value)
Scalar types defined in torch.
Use "JitScalarType" to convert from torch and JIT scalar types to
   ONNX scalar types.
-[ Examples ]-

JitScalarType.from_value(torch.ones(1, 2)).onnx_type()
   TensorProtoDataType.FLOAT
JitScalarType.from_value(torch_c_value_with_type_float).onnx_type()
   TensorProtoDataType.FLOAT
JitScalarType.from_dtype(torch.get_default_dtype).onnx_type()
   TensorProtoDataType.FLOAT

dtype()
  Convert a JitScalarType to a torch dtype.

  Return type:
     *dtype*

classmethod from_dtype(dtype)
  Convert a torch dtype to JitScalarType.

  Note: DO NOT USE this API when *dtype* comes from a
  *torch._C.Value.type()* calls.
     A "RuntimeError: INTERNAL ASSERT FAILED at
     "../aten/src/ATen/core/jit_type_base.h" can be raised in
     several scenarios where shape info is not present. Instead
     use *from_value* API which is safer.


use from_value API which is safer.
  Parameters:
     **dtype** (*Optional**[**dtype**]*) -- A torch.dtype to
     create a JitScalarType from

  Returns:
     JitScalarType

  Raises:
     **OnnxExporterError** -- if dtype is not a valid torch.dtype
     or if it is None.

  Return type:
     *JitScalarType*

classmethod from_value(value, default=None)
  Create a JitScalarType from an value's scalar type.

  Parameters:
     * **value** (*Union**[**None**, **Value**, **Tensor**]*) --
       An object to fetch scalar type from.

     * **default** -- The JitScalarType to return if a valid
       scalar cannot be fetched from value

  Returns:
     JitScalarType.

  Raises:
     * **OnnxExporterError** -- if value does not have a valid
       scalar type and default is None.

     * **SymbolicValueError** -- when value.type()'s info are
       empty and default is None

  Return type:


Return type:
         JitScalarType
onnx_compatible()
  Return whether this JitScalarType is compatible with ONNX.

  Return type:
     bool

onnx_type()
  Convert a JitScalarType to an ONNX data type.

  Return type:
     *TensorProtoDataType*

scalar_name()
  Convert a JitScalarType to a JIT scalar type name.

  Return type:
     *Literal*['Byte', 'Char', 'Double', 'Float', 'Half', 'Int',
     'Long', 'Short', 'Bool', 'ComplexHalf', 'ComplexFloat',
     'ComplexDouble', 'QInt8', 'QUInt8', 'QInt32', 'BFloat16',
     'Undefined']

torch_name()
  Convert a JitScalarType to a torch type name.

  Return type:
     *Literal*['bool', 'uint8_t', 'int8_t', 'double', 'float',
     'half', 'int', 'int64_t', 'int16_t', 'complex32',
     'complex64', 'complex128', 'qint8', 'quint8', 'qint32',
     'bfloat16']


torch.Tensor.lu
Tensor.lu(pivot=True, get_infos=False)
See "torch.lu()"


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


torch.cuda.comm.scatter
torch.cuda.comm.scatter(tensor, devices=None, chunk_sizes=None, dim=0, streams=None, *, out=None)
Scatters tensor across multiple GPUs.
Parameters:
      * tensor (Tensor) -- tensor to scatter. Can be on CPU or
        GPU.
  * **devices** (*Iterable**[**torch.device**, **str** or
    **int**]**, **optional*) -- an iterable of GPU devices, among
    which to scatter.

  * **chunk_sizes** (*Iterable**[**int**]**, **optional*) -- sizes
    of chunks to be placed on each device. It should match
    "devices" in length and sums to "tensor.size(dim)". If not
    specified, "tensor" will be divided into equal chunks.

  * **dim** (*int**, **optional*) -- A dimension along which to
    chunk "tensor". Default: "0".

  * **streams** (*Iterable**[**Stream**]**, **optional*) -- an
    iterable of Streams, among which to execute the scatter. If
    not specified, the default stream will be utilized.


out (Sequence[Tensor], optional, keyword-
        only) -- the GPU tensors to store output results. Sizes of
        these tensors must match that of "tensor", except for "dim",
        where the total size must sum to "tensor.size(dim)".

Note:
 Exactly one of "devices" and "out" must be specified. When "out"
 is specified, "chunk_sizes" must not be specified and will be
 inferred from sizes of "out".

Returns:
      * If "devices" is specified,
           a tuple containing chunks of "tensor", placed on "devices".
  * If "out" is specified,
       a tuple containing "out" tensors, each containing a chunk
       of "tensor".


torch.sparse.log_softmax
torch.sparse.log_softmax(input, dim, *, dtype=None) -> Tensor
Applies a softmax function followed by logarithm.
See "softmax" for more details.
Parameters:
      * input (Tensor) -- input
  * **dim** (*int*) -- A dimension along which softmax will be
    computed.

  * **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


torch.Tensor.atan2_
Tensor.atan2_(other) -> Tensor
In-place version of "atan2()"


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


torch.inner
torch.inner(input, other, *, out=None) -> Tensor
Computes the dot product for 1D tensors. For higher dimensions,
   sums the product of elements from "input" and "other" along their
   last dimension.
Note:
 If either "input" or "other" is a scalar, the result is
 equivalent to *torch.mul(input, other)*.If both "input" and
 "other" are non-scalars, the size of their last dimension must
 match and the result is equivalent to *torch.tensordot(input,
 other, dims=([-1], [-1]))*

Parameters:
      * input (Tensor) -- First input tensor
  * **other** (*Tensor*) -- Second input tensor

Keyword Arguments:
      out (Tensor, optional) -- Optional output tensor to
      write result into. The output shape is input.shape[:-1] +
      other.shape[:-1].
Example:
  # Dot product
  >>> torch.inner(torch.tensor([1, 2, 3]), torch.tensor([0, 2, 1]))
  tensor(7)

  # Multidimensional input tensors


Multidimensional input tensors
  >>> a = torch.randn(2, 3)
  >>> a
  tensor([[0.8173, 1.0874, 1.1784],
          [0.3279, 0.1234, 2.7894]])
  >>> b = torch.randn(2, 4, 3)
  >>> b
  tensor([[[-0.4682, -0.7159,  0.1506],
          [ 0.4034, -0.3657,  1.0387],
          [ 0.9892, -0.6684,  0.1774],
          [ 0.9482,  1.3261,  0.3917]],

          [[ 0.4537,  0.7493,  1.1724],
          [ 0.2291,  0.5749, -0.2267],
          [-0.7920,  0.3607, -0.3701],
          [ 1.3666, -0.5850, -1.7242]]])
  >>> torch.inner(a, b)
  tensor([[[-0.9837,  1.1560,  0.2907,  2.6785],
          [ 2.5671,  0.5452, -0.6912, -1.5509]],

          [[ 0.1782,  2.9843,  0.7366,  1.5672],
          [ 3.5115, -0.4864, -1.2476, -4.4337]]])

  # Scalar input
  >>> torch.inner(a, torch.tensor(2))
  tensor([[1.6347, 2.1748, 2.3567],
          [0.6558, 0.2469, 5.5787]])


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


torch.Tensor.t_
Tensor.t_() -> Tensor
In-place version of "t()"


torch.Tensor.cholesky
Tensor.cholesky(upper=False) -> Tensor
See "torch.cholesky()"


LSTMCell
class torch.nn.LSTMCell(input_size, hidden_size, bias=True, device=None, dtype=None)
A long short-term memory (LSTM) cell.
  \begin{array}{ll} i = \sigma(W_{ii} x + b_{ii} + W_{hi} h +
  b_{hi}) \\ f = \sigma(W_{if} x + b_{if} + W_{hf} h + b_{hf}) \\
  g = \tanh(W_{ig} x + b_{ig} + W_{hg} h + b_{hg}) \\ o =
  \sigma(W_{io} x + b_{io} + W_{ho} h + b_{ho}) \\ c' = f * c + i
  * g \\ h' = o * \tanh(c') \\ \end{array}

where \sigma is the sigmoid function, and * is the Hadamard
   product.
Parameters:
      * input_size (int) -- The number of expected features in
        the input x
  * **hidden_size** (*int*) -- The number of features in the
    hidden state *h*

  * **bias** (*bool*) -- If "False", then the layer does not use
    bias weights *b_ih* and *b_hh*. Default: "True"

Inputs: input, (h_0, c_0)
      * input of shape (batch, input_size) or (input_size):
        tensor containing input features


tensor containing input features
  * **h_0** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the initial hidden state

  * **c_0** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the initial cell state

    If *(h_0, c_0)* is not provided, both **h_0** and **c_0**
    default to zero.

Outputs: (h_1, c_1)
      * h_1 of shape (batch, hidden_size) or (hidden_size):
        tensor containing the next hidden state
  * **c_1** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the next cell state

Variables:
      * weight_ih (torch.Tensor) -- the learnable input-hidden
        weights, of shape (4hidden_size, input_size)*
  * **weight_hh** (*torch.Tensor*) -- the learnable hidden-hidden
    weights, of shape *(4*hidden_size, hidden_size)*

  * **bias_ih** -- the learnable input-hidden bias, of shape
    *(4*hidden_size)*


(4hidden_size)*
  * **bias_hh** -- the learnable hidden-hidden bias, of shape
    *(4*hidden_size)*

Note:
 All the weights and biases are initialized from
 \mathcal{U}(-\sqrt{k}, \sqrt{k}) where k =
 \frac{1}{\text{hidden\_size}}

On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.
Examples:
  >>> rnn = nn.LSTMCell(10, 20)  # (input_size, hidden_size)
  >>> input = torch.randn(2, 3, 10)  # (time_steps, batch, input_size)
  >>> hx = torch.randn(3, 20)  # (batch, hidden_size)
  >>> cx = torch.randn(3, 20)
  >>> output = []
  >>> for i in range(input.size()[0]):
  ...     hx, cx = rnn(input[i], (hx, cx))
  ...     output.append(hx)
  >>> output = torch.stack(output, dim=0)


conv3d
class torch.ao.nn.quantized.functional.conv3d(input, weight, bias, stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', scale=1.0, zero_point=0, dtype=torch.quint8)
Applies a 3D convolution over a quantized 3D input composed of
   several input planes.
See "Conv3d" for details and output shape.
Parameters:
      * input -- quantized input tensor of shape (\text{minibatch}
        , \text{in_channels} , iD , iH , iW)
  * **weight** -- quantized filters of shape (\text{out\_channels}
    , \frac{\text{in\_channels}}{\text{groups}} , kD , kH , kW)

  * **bias** -- **non-quantized** bias tensor of shape
    (\text{out\_channels}). The tensor type must be *torch.float*.

  * **stride** -- the stride of the convolving kernel. Can be a
    single number or a tuple *(sD, sH, sW)*. Default: 1

  * **padding** -- implicit paddings on both sides of the input.
    Can be a single number or a tuple *(padD, padH, padW)*.
    Default: 0


Default: 0
  * **dilation** -- the spacing between kernel elements. Can be a
    single number or a tuple *(dD, dH, dW)*. Default: 1

  * **groups** -- split input into groups, \text{in\_channels}
    should be divisible by the number of groups. Default: 1

  * **padding_mode** -- the padding mode to use. Only "zeros" is
    supported for quantized convolution at the moment. Default:
    "zeros"

  * **scale** -- quantization scale for the output. Default: 1.0

  * **zero_point** -- quantization zero_point for the output.
    Default: 0

  * **dtype** -- quantization data type to use. Default:
    "torch.quint8"

Examples:
  >>> from torch.ao.nn.quantized import functional as qF
  >>> filters = torch.randn(8, 4, 3, 3, 3, dtype=torch.float)
  >>> inputs = torch.randn(1, 4, 5, 5, 5, dtype=torch.float)
  >>> bias = torch.randn(8, dtype=torch.float)
  >>>
  >>> scale, zero_point = 1.0, 0
  >>> dtype_inputs = torch.quint8


dtype_inputs = torch.quint8
      >>> dtype_filters = torch.qint8
      >>>
      >>> q_filters = torch.quantize_per_tensor(filters, scale, zero_point, dtype_filters)
      >>> q_inputs = torch.quantize_per_tensor(inputs, scale, zero_point, dtype_inputs)
      >>> qF.conv3d(q_inputs, q_filters, bias, padding=1, scale=scale, zero_point=zero_point)


torch.nn.utils.prune.is_pruned
torch.nn.utils.prune.is_pruned(module)
Check whether "module" is pruned by looking for "forward_pre_hooks"
   in its modules that inherit from the "BasePruningMethod".
Parameters:
      module (nn.Module) -- object that is either pruned or
      unpruned
Returns:
      binary answer to whether "module" is pruned.
-[ Examples ]-

from torch.nn.utils import prune
m = nn.Linear(5, 7)
print(prune.is_pruned(m))
   False
prune.random_unstructured(m, name='weight', amount=0.2)
print(prune.is_pruned(m))
   True


torch.Tensor.ndim
Tensor.ndim
Alias for "dim()"


max_pool1d
class torch.ao.nn.quantized.functional.max_pool1d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
Applies a 1D max pooling over a quantized input signal composed of
   several quantized input planes.
Note:
 The input quantization parameters are propagated to the output.

See "MaxPool1d" for details.


torch.cuda.ipc_collect
torch.cuda.ipc_collect()
Force collects GPU memory after it has been released by CUDA IPC.
Note:
 Checks if any sent CUDA tensors could be cleaned from the memory.
 Force closes shared memory file used for reference counting if
 there is no active counters. Useful when the producer process
 stopped actively sending tensors and want to release unused
 memory.


torch.Tensor.conj_physical_
Tensor.conj_physical_() -> Tensor
In-place version of "conj_physical()"


torch.Tensor.view_as
Tensor.view_as(other) -> Tensor
View this tensor as the same size as "other". "self.view_as(other)"
   is equivalent to "self.view(other.size())".
Please see "view()" for more information about "view".
Parameters:
      other ("torch.Tensor") -- The result tensor has the same
      size as "other".


torch.Tensor.mvlgamma_
Tensor.mvlgamma_(p) -> Tensor
In-place version of "mvlgamma()"


torch.add
torch.add(input, other, *, alpha=1, out=None) -> Tensor
Adds "other", scaled by "alpha", to "input".
  \text{{out}}_i = \text{{input}}_i + \text{{alpha}} \times
  \text{{other}}_i

Supports broadcasting to a common shape, type promotion, and
   integer, float, and complex inputs.
Parameters:
      * input (Tensor) -- the input tensor.
  * **other** (*Tensor** or **Number*) -- the tensor or number to
    add to "input".

Keyword Arguments:
      * alpha (Number) -- the multiplier for "other".
  * **out** (*Tensor**, **optional*) -- the output tensor.

Examples:
  >>> a = torch.randn(4)
  >>> a
  tensor([ 0.0202,  1.0985,  1.3506, -0.6056])
  >>> torch.add(a, 20)
  tensor([ 20.0202,  21.0985,  21.3506,  19.3944])

  >>> b = torch.randn(4)
  >>> b
  tensor([-0.9732, -0.3497,  0.6245,  0.4022])
  >>> c = torch.randn(4, 1)
  >>> c
  tensor([[ 0.3743],
          [-1.7724],


tensor([[ 0.3743],
              [-1.7724],
              [-0.5811],
              [-0.8017]])
      >>> torch.add(b, c, alpha=10)
      tensor([[  2.7695,   3.3930,   4.3672,   4.1450],
              [-18.6971, -18.0736, -17.0994, -17.3216],
              [ -6.7845,  -6.1610,  -5.1868,  -5.4090],
              [ -8.9902,  -8.3667,  -7.3925,  -7.6147]])


torch.cuda.get_sync_debug_mode
torch.cuda.get_sync_debug_mode()
Returns current value of debug mode for cuda synchronizing
   operations.
Return type:
      int


torch.cat
torch.cat(tensors, dim=0, *, out=None) -> Tensor
Concatenates the given sequence of "seq" tensors in the given
   dimension. All tensors must either have the same shape (except in
   the concatenating dimension) or be empty.
"torch.cat()" can be seen as an inverse operation for
   "torch.split()" and "torch.chunk()".
"torch.cat()" can be best understood via examples.
Parameters:
      * tensors (sequence of Tensors) -- any python sequence of
        tensors of the same type. Non-empty tensors provided must have
        the same shape, except in the cat dimension.
  * **dim** (*int**, **optional*) -- the dimension over which the
    tensors are concatenated

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> x = torch.randn(2, 3)
  >>> x
  tensor([[ 0.6580, -1.0969, -0.4614],
          [-0.1034, -0.5790,  0.1497]])
  >>> torch.cat((x, x, x), 0)
  tensor([[ 0.6580, -1.0969, -0.4614],


tensor([[ 0.6580, -1.0969, -0.4614],
              [-0.1034, -0.5790,  0.1497],
              [ 0.6580, -1.0969, -0.4614],
              [-0.1034, -0.5790,  0.1497],
              [ 0.6580, -1.0969, -0.4614],
              [-0.1034, -0.5790,  0.1497]])
      >>> torch.cat((x, x, x), 1)
      tensor([[ 0.6580, -1.0969, -0.4614,  0.6580, -1.0969, -0.4614,  0.6580,
               -1.0969, -0.4614],
              [-0.1034, -0.5790,  0.1497, -0.1034, -0.5790,  0.1497, -0.1034,
               -0.5790,  0.1497]])


torch.load
torch.load(f, map_location=None, pickle_module=pickle, , weights_only=False, *pickle_load_args)
Loads an object saved with "torch.save()" from a file.
"torch.load()" uses Python's unpickling facilities but treats
   storages, which underlie tensors, specially. They are first
   deserialized on the CPU and are then moved to the device they were
   saved from. If this fails (e.g. because the run time system doesn't
   have certain devices), an exception is raised. However, storages
   can be dynamically remapped to an alternative set of devices using
   the "map_location" argument.
If "map_location" is a callable, it will be called once for each
   serialized storage with two arguments: storage and location. The
   storage argument will be the initial deserialization of the
   storage, residing on the CPU. Each serialized storage has a
   location tag associated with it which identifies the device it was
   saved from, and this tag is the second argument passed to


"map_location". The builtin location tags are "'cpu'" for CPU
   tensors and "'cuda:device_id'" (e.g. "'cuda:2'") for CUDA tensors.
   "map_location" should return either "None" or a storage. If
   "map_location" returns a storage, it will be used as the final
   deserialized object, already moved to the right device. Otherwise,
   "torch.load()" will fall back to the default behavior, as if
   "map_location" wasn't specified.
If "map_location" is a "torch.device" object or a string containing
   a device tag, it indicates the location where all tensors should be
   loaded.
Otherwise, if "map_location" is a dict, it will be used to remap
   location tags appearing in the file (keys), to ones that specify
   where to put the storages (values).
User extensions can register their own location tags and tagging
   and deserialization methods using
   "torch.serialization.register_package()".
Parameters:
      * f (Union[str, PathLike, BinaryIO*,


IO[bytes]*]) -- a file-like object (has to implement
        "read()", "readline()", "tell()", and "seek()"), or a string
        or os.PathLike object containing a file name
  * **map_location**
    (*Optional**[**Union**[**Callable**[**[**Tensor**, **str**]**,
    **Tensor**]**, **device**, **str**, **Dict**[**str**,
    **str**]**]**]*) -- a function, "torch.device", string or a
    dict specifying how to remap storage locations

  * **pickle_module** (*Optional**[**Any**]*) -- module used for
    unpickling metadata and objects (has to match the
    "pickle_module" used to serialize file)

  * **weights_only** (*bool*) -- Indicates whether unpickler
    should be restricted to loading only tensors, primitive types
    and dictionaries

  * **pickle_load_args** (*Any*) -- (Python 3 only) optional
    keyword arguments passed over to "pickle_module.load()" and
    "pickle_module.Unpickler()", e.g., "errors=...".

Return type:


Return type:
      Any
Warning:
 "torch.load()" unless *weights_only* parameter is set to *True*,
 uses "pickle" module implicitly, which is known to be insecure.
 It is possible to construct malicious pickle data which will
 execute arbitrary code during unpickling. Never load data that
 could have come from an untrusted source in an unsafe mode, or
 that could have been tampered with. **Only load data you trust**.

Note:
 When you call "torch.load()" on a file which contains GPU
 tensors, those tensors will be loaded to GPU by default. You can
 call "torch.load(.., map_location='cpu')" and then
 "load_state_dict()" to avoid GPU RAM surge when loading a model
 checkpoint.

Note:
 By default, we decode byte strings as "utf-8".  This is to avoid
 a common error case "UnicodeDecodeError: 'ascii' codec can't
 decode byte 0x..." when loading files saved by Python 2 in Python


If this default is incorrect, you may use an extra "encoding"
     keyword argument to specify how these objects should be loaded,
     e.g., "encoding='latin1'" decodes them to strings using "latin1"
     encoding, and "encoding='bytes'" keeps them as byte arrays which
     can be decoded later with "byte_array.decode(...)".

-[ Example ]-

torch.load('tensors.pt')
   # Load all tensors onto the CPU
torch.load('tensors.pt', map_location=torch.device('cpu'))
   # Load all tensors onto the CPU, using a function
torch.load('tensors.pt', map_location=lambda storage, loc: storage)
   # Load all tensors onto GPU 1
torch.load('tensors.pt', map_location=lambda storage, loc: storage.cuda(1))
   # Map tensors from GPU 1 to GPU 0
torch.load('tensors.pt', map_location={'cuda:1': 'cuda:0'})
   # Load tensor from io.BytesIO object
with open('tensor.pt', 'rb') as f:
   ...     buffer = io.BytesIO(f.read())
torch.load(buffer)


torch.load(buffer)
   # Load a module with 'ascii' encoding for unpickling
torch.load('module.pt', encoding='ascii')


torch.Tensor.unflatten
Tensor.unflatten(dim, sizes) -> Tensor
See "torch.unflatten()".


torch.quantile
torch.quantile(input, q, dim=None, keepdim=False, *, interpolation='linear', out=None) -> Tensor
Computes the q-th quantiles of each row of the "input" tensor along
   the dimension "dim".
To compute the quantile, we map q in [0, 1] to the range of indices
   [0, n] to find the location of the quantile in the sorted input. If
   the quantile lies between two data points "a < b" with indices "i"
   and "j" in the sorted order, result is computed according to the
   given "interpolation" method as follows:

"linear": "a + (b - a) * fraction", where "fraction" is the
     fractional part of the computed quantile index.

"lower": "a".

"higher": "b".

"nearest": "a" or "b", whichever's index is closer to the
     computed quantile index (rounding down for .5 fractions).

"midpoint": "(a + b) / 2".

If "q" is a 1D tensor, the first dimension of the output represents
   the quantiles and has size equal to the size of "q", the remaining


dimensions are what remains from the reduction.
Note:
 By default "dim" is "None" resulting in the "input" tensor being
 flattened before computation.

Parameters:
      * input (Tensor) -- the input tensor.
  * **q** (*float** or **Tensor*) -- a scalar or 1D tensor of
    values in the range [0, 1].

  * **dim** (*int*) -- the dimension to reduce.

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

Keyword Arguments:
      * interpolation (str) -- interpolation method to use when
        the desired quantile lies between two data points. Can be
        "linear", "lower", "higher", "midpoint" and "nearest". Default
        is "linear".
  * **out** (*Tensor**, **optional*) -- the output tensor.

Example:
  >>> a = torch.randn(2, 3)
  >>> a
  tensor([[ 0.0795, -1.2117,  0.9765],
          [ 1.1707,  0.6706,  0.4884]])
  >>> q = torch.tensor([0.25, 0.5, 0.75])


q = torch.tensor([0.25, 0.5, 0.75])
      >>> torch.quantile(a, q, dim=1, keepdim=True)
      tensor([[[-0.5661],
              [ 0.5795]],

          [[ 0.0795],
          [ 0.6706]],

          [[ 0.5280],
          [ 0.9206]]])
  >>> torch.quantile(a, q, dim=1, keepdim=True).shape
  torch.Size([3, 2, 1])
  >>> a = torch.arange(4.)
  >>> a
  tensor([0., 1., 2., 3.])
  >>> torch.quantile(a, 0.6, interpolation='linear')
  tensor(1.8000)
  >>> torch.quantile(a, 0.6, interpolation='lower')
  tensor(1.)
  >>> torch.quantile(a, 0.6, interpolation='higher')
  tensor(2.)
  >>> torch.quantile(a, 0.6, interpolation='midpoint')
  tensor(1.5000)
  >>> torch.quantile(a, 0.6, interpolation='nearest')
  tensor(2.)
  >>> torch.quantile(a, 0.4, interpolation='nearest')
  tensor(1.)


torch.Tensor.to
Tensor.to(args, *kwargs) -> Tensor
Performs Tensor dtype and/or device conversion. A "torch.dtype" and
   "torch.device" are inferred from the arguments of "self.to(args,
   *kwargs)".
Note:
 If the "self" Tensor already has the correct "torch.dtype" and
 "torch.device", then "self" is returned. Otherwise, the returned
 tensor is a copy of "self" with the desired "torch.dtype" and
 "torch.device".

Here are the ways to call "to":
to(dtype, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor
     Returns a Tensor with the specified "dtype"

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

torch.to(device=None, dtype=None, non_blocking=False, copy=False, memory_format=torch.preserve_format) -> Tensor
     Returns a Tensor with the specified "device" and (optional)


"dtype". If "dtype" is "None" it is inferred to be
         "self.dtype". When "non_blocking", tries to convert
         asynchronously with respect to the host if possible, e.g.,
         converting a CPU Tensor with pinned memory to a CUDA Tensor.
         When "copy" is set, a new Tensor is created even when the
         Tensor already matches the desired conversion.
     Args:
        memory_format ("torch.memory_format", optional): the
        desired memory format of returned Tensor. Default:
        "torch.preserve_format".

torch.to(other, non_blocking=False, copy=False) -> Tensor
     Returns a Tensor with same "torch.dtype" and "torch.device"
     as the Tensor "other". When "non_blocking", tries to convert
     asynchronously with respect to the host if possible, e.g.,
     converting a CPU Tensor with pinned memory to a CUDA Tensor.
     When "copy" is set, a new Tensor is created even when the


Tensor already matches the desired conversion.
Example:
  >>> tensor = torch.randn(2, 2)  # Initially dtype=float32, device=cpu
  >>> tensor.to(torch.float64)
  tensor([[-0.5044,  0.0005],
          [ 0.3310, -0.0584]], dtype=torch.float64)

  >>> cuda0 = torch.device('cuda:0')
  >>> tensor.to(cuda0)
  tensor([[-0.5044,  0.0005],
          [ 0.3310, -0.0584]], device='cuda:0')

  >>> tensor.to(cuda0, dtype=torch.float64)
  tensor([[-0.5044,  0.0005],
          [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0')

  >>> other = torch.randn((), dtype=torch.float64, device=cuda0)
  >>> tensor.to(other, non_blocking=True)
  tensor([[-0.5044,  0.0005],
          [ 0.3310, -0.0584]], dtype=torch.float64, device='cuda:0')


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


torch.Tensor.baddbmm
Tensor.baddbmm(batch1, batch2, *, beta=1, alpha=1) -> Tensor
See "torch.baddbmm()"


add_quant_dequant
class torch.quantization.add_quant_dequant(module)
Wrap the leaf child module in QuantWrapper if it has a valid
   qconfig Note that this function will modify the children of module
   inplace and it can return a new module which wraps the input module
   as well.
Parameters:
      * module -- input module with qconfig attributes for all the
        leaf modules
  * **quantize** (*that we want to*) --

Returns:
      Either the inplace modified module with submodules wrapped in
      QuantWrapper based on qconfig or a new QuantWrapper module
      which wraps the input module, the latter case only happens when
      the input module is a leaf module and we want to quantize it.


RecordingObserver
class torch.quantization.observer.RecordingObserver(dtype=torch.quint8, **kwargs)
The module is mainly for debug and records the tensor values during
   runtime.
Parameters:
      * dtype -- Quantized data type
  * **qscheme** -- Quantization scheme to be used

  * **reduce_range** -- Reduces the range of the quantized data
    type by 1 bit


torch.Tensor.is_signed
Tensor.is_signed() -> bool
Returns True if the data type of "self" is a signed data type.


torch.broadcast_to
torch.broadcast_to(input, shape) -> Tensor
Broadcasts "input" to the shape "shape". Equivalent to calling
   "input.expand(shape)". See "expand()" for details.
Parameters:
      * input (Tensor) -- the input tensor.
  * **shape** (list, tuple, or "torch.Size") -- the new shape.

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


Hardswish
class torch.nn.Hardswish(inplace=False)
Applies the Hardswish function, element-wise, as described in the
   paper: Searching for MobileNetV3.
Hardswish is defined as:
  \text{Hardswish}(x) = \begin{cases}     0 & \text{if~} x \le -3,
  \\     x & \text{if~} x \ge +3, \\     x \cdot (x + 3) /6 &
  \text{otherwise} \end{cases}

Parameters:
      inplace (bool) -- can optionally do the operation in-
      place. Default: "False"
Shape:
      * Input: (*), where * means any number of dimensions.
  * Output: (*), same shape as the input.

[image]
Examples:
  >>> m = nn.Hardswish()
  >>> input = torch.randn(2)
  >>> output = m(input)


torch.Tensor.greater_
Tensor.greater_(other) -> Tensor
In-place version of "greater()".


ReduceLROnPlateau
class torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='min', factor=0.1, patience=10, threshold=0.0001, threshold_mode='rel', cooldown=0, min_lr=0, eps=1e-08, verbose=False)
Reduce learning rate when a metric has stopped improving. Models
   often benefit from reducing the learning rate by a factor of 2-10
   once learning stagnates. This scheduler reads a metrics quantity
   and if no improvement is seen for a 'patience' number of epochs,
   the learning rate is reduced.
Parameters:
      * optimizer (Optimizer) -- Wrapped optimizer.
  * **mode** (*str*) -- One of *min*, *max*. In *min* mode, lr
    will be reduced when the quantity monitored has stopped
    decreasing; in *max* mode it will be reduced when the quantity
    monitored has stopped increasing. Default: 'min'.

  * **factor** (*float*) -- Factor by which the learning rate will
    be reduced. new_lr = lr * factor. Default: 0.1.


patience (int) -- Number of epochs with no improvement
        after which learning rate will be reduced. For example, if
        patience = 2, then we will ignore the first 2 epochs with no
        improvement, and will only decrease the LR after the 3rd epoch
        if the loss still hasn't improved then. Default: 10.

threshold (float) -- Threshold for measuring the new
    optimum, to only focus on significant changes. Default: 1e-4.

threshold_mode (str) -- One of rel, abs. In rel
    mode, dynamic_threshold = best * ( 1 + threshold ) in 'max'
    mode or best * ( 1 - threshold ) in min mode. In abs mode,
    dynamic_threshold = best + threshold in max mode or best -
    threshold in min mode. Default: 'rel'.

cooldown (int) -- Number of epochs to wait before
    resuming normal operation after lr has been reduced. Default:
    0.

min_lr (float or list) -- A scalar or a list of


scalars. A lower bound on the learning rate of all param
        groups or each group respectively. Default: 0.
  * **eps** (*float*) -- Minimal decay applied to lr. If the
    difference between new and old lr is smaller than eps, the
    update is ignored. Default: 1e-8.

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

-[ Example ]-

optimizer = torch.optim.SGD(model.parameters(), lr=0.1, momentum=0.9)
scheduler = ReduceLROnPlateau(optimizer, 'min')
for epoch in range(10):
    train(...)
    val_loss = validate(...)
    # Note that step should be called after validate()
    scheduler.step(val_loss)


UninitializedBuffer
class torch.nn.parameter.UninitializedBuffer(requires_grad=False, device=None, dtype=None)
A buffer that is not initialized.
Uninitialized Buffer is a a special case of "torch.Tensor" where
   the shape of the data is still unknown.
Unlike a "torch.Tensor", uninitialized parameters hold no data and
   attempting to access some properties, like their shape, will throw
   a runtime error. The only operations that can be performed on a
   uninitialized parameter are changing its datatype, moving it to a
   different device and converting it to a regular "torch.Tensor".
The default device or dtype to use when the buffer is materialized
   can be set during construction using e.g. "device='cuda'".


ConvTranspose3d
class torch.ao.nn.quantized.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1, padding_mode='zeros', device=None, dtype=None)
Applies a 3D transposed convolution operator over an input image
   composed of several input planes. For details on input arguments,
   parameters, and implementation see "ConvTranspose3d".
Note:
 Currently only the FBGEMM engine is implemented. Please, set the
 *torch.backends.quantized.engine = 'fbgemm'*

For special notes, please, see "Conv3d"
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 "ConvTranspose3d" for other attributes.
Examples:
  >>> torch.backends.quantized.engine = 'fbgemm'
  >>> from torch.nn import quantized as nnq


from torch.nn import quantized as nnq
      >>> # With cubic kernels and equal stride
      >>> m = nnq.ConvTranspose3d(16, 33, 3, stride=2)
      >>> # non-cubic kernels and unequal stride and with padding
      >>> m = nnq.ConvTranspose3d(16, 33, (3, 3, 5), stride=(2, 1, 1), padding=(4, 2, 2))
      >>> input = torch.randn(20, 16, 50, 100, 100)
      >>> q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0, dtype=torch.quint8)
      >>> output = m(q_input)
      >>> # exact output size can be also specified as an argument
      >>> input = torch.randn(1, 16, 12, 12, 12)
      >>> q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0, dtype=torch.quint8)
      >>> downsample = nnq.Conv3d(16, 16, 3, stride=2, padding=1)
      >>> upsample = nnq.ConvTranspose3d(16, 16, 3, stride=2, padding=1)
      >>> h = downsample(q_input)
      >>> h.size()
      torch.Size([1, 16, 6, 6, 6])
      >>> output = upsample(h, output_size=input.size())
      >>> output.size()


output.size()
      torch.Size([1, 16, 12, 12, 12])


torch.cuda.is_initialized
torch.cuda.is_initialized()
Returns whether PyTorch's CUDA state has been initialized.


torch.autograd.function.FunctionCtx.mark_dirty
FunctionCtx.mark_dirty(*args)
Marks given tensors as modified in an in-place operation.
This should be called at most once, only from inside the
   "forward()" method, and all arguments should be inputs.
Every tensor that's been modified in-place in a call to "forward()"
   should be given to this function, to ensure correctness of our
   checks. It doesn't matter whether the function is called before or
   after modification.
Examples::
      >>> class Inplace(Function):
      >>>     @staticmethod
      >>>     def forward(ctx, x):
      >>>         x_npy = x.numpy() # x_npy shares storage with x
      >>>         x_npy += 1
      >>>         ctx.mark_dirty(x)
      >>>         return x
      >>>
      >>>     @staticmethod
      >>>     @once_differentiable
      >>>     def backward(ctx, grad_output):
      >>>         return grad_output
      >>>


    return grad_output
  >>>
  >>> a = torch.tensor(1., requires_grad=True, dtype=torch.double).clone()
  >>> b = a * a
  >>> Inplace.apply(a)  # This would lead to wrong gradients!
  >>>                   # but the engine would not know unless we mark_dirty
  >>> b.backward() # RuntimeError: one of the variables needed for gradient
  >>>              # computation has been modified by an inplace operation


torch.Tensor.index_put
Tensor.index_put(indices, values, accumulate=False) -> Tensor
Out-place version of "index_put_()".


torch.quantize_per_tensor
torch.quantize_per_tensor(input, scale, zero_point, dtype) -> Tensor
Converts a float tensor to a quantized tensor with given scale and
   zero point.
Parameters:
      * input (Tensor) -- float tensor or list of tensors to
        quantize
  * **scale** (*float** or **Tensor*) -- scale to apply in
    quantization formula

  * **zero_point** (*int** or **Tensor*) -- offset in integer
    value that maps to float zero

  * **dtype** ("torch.dtype") -- the desired data type of returned
    tensor. Has to be one of the quantized dtypes: "torch.quint8",
    "torch.qint8", "torch.qint32"

Returns:
      A newly quantized tensor or list of quantized tensors.
Return type:
      Tensor
Example:
  >>> torch.quantize_per_tensor(torch.tensor([-1.0, 0.0, 1.0, 2.0]), 0.1, 10, torch.quint8)
  tensor([-1.,  0.,  1.,  2.], size=(4,), dtype=torch.quint8,


quantization_scheme=torch.per_tensor_affine, scale=0.1, zero_point=10)
      >>> torch.quantize_per_tensor(torch.tensor([-1.0, 0.0, 1.0, 2.0]), 0.1, 10, torch.quint8).int_repr()
      tensor([ 0, 10, 20, 30], dtype=torch.uint8)
      >>> torch.quantize_per_tensor([torch.tensor([-1.0, 0.0]), torch.tensor([-2.0, 2.0])],
      >>> torch.tensor([0.1, 0.2]), torch.tensor([10, 20]), torch.quint8)
      (tensor([-1.,  0.], size=(2,), dtype=torch.quint8,
          quantization_scheme=torch.per_tensor_affine, scale=0.1, zero_point=10),
          tensor([-2.,  2.], size=(2,), dtype=torch.quint8,
          quantization_scheme=torch.per_tensor_affine, scale=0.2, zero_point=20))
      >>> torch.quantize_per_tensor(torch.tensor([-1.0, 0.0, 1.0, 2.0]), torch.tensor(0.1), torch.tensor(10), torch.quint8)
      tensor([-1.,  0.,  1.,  2.], size=(4,), dtype=torch.quint8,
         quantization_scheme=torch.per_tensor_affine, scale=0.10, zero_point=10)


torch.svd_lowrank
torch.svd_lowrank(A, q=6, niter=2, M=None)
Return the singular value decomposition "(U, S, V)" of a matrix,
   batches of matrices, or a sparse matrix A such that A \approx U
   diag(S) V^T. In case M is given, then SVD is computed for the
   matrix A - M.
Note:
 The implementation is based on the Algorithm 5.1 from Halko et
 al, 2009.

Note:
 To obtain repeatable results, reset the seed for the pseudorandom
 number generator

Note:
 The input is assumed to be a low-rank matrix.

Note:
 In general, use the full-rank SVD implementation
 "torch.linalg.svd()" for dense matrices due to its 10-fold higher
 performance characteristics. The low-rank SVD will be useful for
 huge sparse matrices that "torch.linalg.svd()" cannot handle.

Args::
      A (Tensor): the input tensor of size (*, m, n)
  q (int, optional): a slightly overestimated rank of A.

  niter (int, optional): the number of subspace iterations to


conduct; niter must be a nonnegative integer, and defaults to
         2
  M (Tensor, optional): the input tensor's mean of size
     (*, 1, n).

References::
      * Nathan Halko, Per-Gunnar Martinsson, and Joel Tropp, Finding
        structure with randomness: probabilistic algorithms for
        constructing approximate matrix decompositions,
        arXiv:0909.4061 [math.NA; math.PR], 2009 (available at arXiv).
Return type:
      Tuple[Tensor, Tensor, Tensor]


torch.allclose
torch.allclose(input, other, rtol=1e-05, atol=1e-08, equal_nan=False) -> bool
This function checks if "input" and "other" satisfy the condition:
  \lvert \text{input} - \text{other} \rvert \leq \texttt{atol} +
  \texttt{rtol} \times \lvert \text{other} \rvert

elementwise, for all elements of "input" and "other". The behaviour
   of this function is analogous to numpy.allclose
Parameters:
      * input (Tensor) -- first tensor to compare
  * **other** (*Tensor*) -- second tensor to compare

  * **atol** (*float**, **optional*) -- absolute tolerance.
    Default: 1e-08

  * **rtol** (*float**, **optional*) -- relative tolerance.
    Default: 1e-05

  * **equal_nan** (*bool**, **optional*) -- if "True", then two
    "NaN" s will be considered equal. Default: "False"

Example:
  >>> torch.allclose(torch.tensor([10000., 1e-07]), torch.tensor([10000.1, 1e-08]))
  False


False
      >>> torch.allclose(torch.tensor([10000., 1e-08]), torch.tensor([10000.1, 1e-09]))
      True
      >>> torch.allclose(torch.tensor([1.0, float('nan')]), torch.tensor([1.0, float('nan')]))
      False
      >>> torch.allclose(torch.tensor([1.0, float('nan')]), torch.tensor([1.0, float('nan')]), equal_nan=True)
      True


FeatureAlphaDropout
class torch.nn.FeatureAlphaDropout(p=0.5, inplace=False)
Randomly masks out entire channels (a channel is a feature map,
   e.g. the j-th channel of the i-th sample in the batch input is a
   tensor \text{input}[i, j]) of the input tensor). Instead of setting
   activations to zero, as in regular Dropout, the activations are set
   to the negative saturation value of the SELU activation function.
   More details can be found in the paper Self-Normalizing Neural
   Networks .
Each element will be masked independently for each sample on every
   forward call with probability "p" using samples from a Bernoulli
   distribution. The elements to be masked are randomized on every
   forward call, and scaled and shifted to maintain zero mean and unit
   variance.
Usually the input comes from "nn.AlphaDropout" modules.
As described in the paper Efficient Object Localization Using
   Convolutional Networks , if adjacent pixels within feature maps are


strongly correlated (as is normally the case in early convolution
   layers) then i.i.d. dropout will not regularize the activations and
   will otherwise just result in an effective learning rate decrease.
In this case, "nn.AlphaDropout()" will help promote independence
   between feature maps and should be used instead.
Parameters:
      * p (float, optional) -- probability of an element to
        be zeroed. Default: 0.5
  * **inplace** (*bool**, **optional*) -- If set to "True", will
    do this operation in-place

Shape:
      * Input: (N, C, D, H, W) or (C, D, H, W).
  * Output: (N, C, D, H, W) or (C, D, H, W) (same shape as input).

Examples:
  >>> m = nn.FeatureAlphaDropout(p=0.2)
  >>> input = torch.randn(20, 16, 4, 32, 32)
  >>> output = m(input)


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


torch.cuda.memory_reserved
torch.cuda.memory_reserved(device=None)
Returns the current GPU memory managed by the caching allocator in
   bytes for a given device.
Parameters:
      device (torch.device or int, optional) -- selected
      device. Returns statistic for the current device, given by
      "current_device()", if "device" is "None" (default).
Return type:
      int
Note:
 See Memory management for more details about GPU memory
 management.


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


torch.sym_int
torch.sym_int(a)
SymInt-aware utility for int casting.
Parameters:
      a (SymInt, SymFloat, or object) -- Object to cast


torch.fft.ifft2
torch.fft.ifft2(input, s=None, dim=(- 2, - 1), norm=None, *, out=None) -> Tensor
Computes the 2 dimensional inverse discrete Fourier transform of
   "input". Equivalent to "ifftn()" but IFFTs only the last two
   dimensions by default.
Note:
 Supports torch.half and torch.chalf on CUDA with GPU Architecture
 SM53 or greater. However it only supports powers of 2 signal
 length in every transformed dimensions.

Parameters:
      * input (Tensor) -- the input tensor
  * **s** (*Tuple**[**int**]**, **optional*) -- Signal size in the
    transformed dimensions. If given, each dimension "dim[i]" will
    either be zero-padded or trimmed to the length "s[i]" before
    computing the IFFT. If a length "-1" is specified, no padding
    is done in that dimension. Default: "s = [input.size(d) for d
    in dim]"

  * **dim** (*Tuple**[**int**]**, **optional*) -- Dimensions to be
    transformed. Default: last two dimensions.


norm (str, optional) --Normalization mode. For the backward transform ("ifft2()"),
these correspond to:

* ""forward"" - no normalization

* ""backward"" - normalize by "1/n"

* ""ortho"" - normalize by "1/sqrt(n)" (making the IFFT
  orthonormal)

Where "n = prod(s)" is the logical IFFT size. Calling the
forward transform ("fft2()") with the same normalization mode
will apply an overall normalization of "1/n" between the two
transforms. This is required to make "ifft2()" the exact
inverse.

Default is ""backward"" (normalize by "1/n").

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

x = torch.rand(10, 10, dtype=torch.complex64)
ifft2 = torch.fft.ifft2(x)

The discrete Fourier transform is separable, so "ifft2()" here is
   equivalent to two one-dimensional "ifft()" calls:


two_iffts = torch.fft.ifft(torch.fft.ifft(x, dim=0), dim=1)
torch.testing.assert_close(ifft2, two_iffts, check_stride=False)


torch.nn.functional.leaky_relu_
torch.nn.functional.leaky_relu_(input, negative_slope=0.01) -> Tensor
In-place version of "leaky_relu()".


torch.Tensor.masked_fill_
Tensor.masked_fill_(mask, value)
Fills elements of "self" tensor with "value" where "mask" is True.
   The shape of "mask" must be broadcastable with the shape of the
   underlying tensor.
Parameters:
      * mask (BoolTensor) -- the boolean mask
  * **value** (*float*) -- the value to fill in with


default_weight_fake_quant
torch.quantization.fake_quantize.default_weight_fake_quant
alias of functools.partial(,
   observer=,
   quant_min=-128, quant_max=127, dtype=torch.qint8,
   qscheme=torch.per_tensor_symmetric, reduce_range=False){}


ConvTranspose3d
class torch.nn.ConvTranspose3d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1, padding_mode='zeros', device=None, dtype=None)
Applies a 3D transposed convolution operator over an input image
   composed of several input planes. The transposed convolution
   operator multiplies each input value element-wise by a learnable
   kernel, and sums over the outputs from all input feature planes.
This module can be seen as the gradient of Conv3d with respect to
   its input. It is also known as a fractionally-strided convolution
   or a deconvolution (although it is not an actual deconvolution
   operation as it does not compute a true inverse of convolution).
   For more information, see the visualizations here and the
   Deconvolutional Networks paper.
This module supports TensorFloat32.
On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.


use different precision for backward.

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

"padding" controls the amount of implicit zero padding on both
     sides for "dilation * (kernel_size - 1) - padding" number of
     points. See note below for details.

"output_padding" controls the additional size added to one side
     of the output shape. See note below for details.

"dilation" controls the spacing between the kernel points; also
     known as the Ã  trous algorithm. It is harder to describe, but the
     link here 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", "output_padding"
   can either be:
  * a single "int" -- in which case the same value is used for the
    depth, height and width dimensions

  * 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:
 The "padding" argument effectively adds "dilation * (kernel_size
 - 1) - padding" amount of zero padding to both sizes of the
 input. This is set so that when a "Conv3d" and a
 "ConvTranspose3d" are initialized with same parameters, they are


inverses of each other in regard to the input and output shapes.
     However, when "stride > 1", "Conv3d" maps multiple input shapes
     to the same output shape. "output_padding" is provided to resolve
     this ambiguity by effectively increasing the calculated output
     shape on one side. Note that "output_padding" is only used to
     find output shape, but does not actually add zero-padding to
     output.
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.

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


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

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} = (D_{in} - 1) \times \text{stride}[0] - 2 \times
     \text{padding}[0] + \text{dilation}[0]           \times
     (\text{kernel\_size}[0] - 1) + \text{output\_padding}[0] + 1

     H_{out} = (H_{in} - 1) \times \text{stride}[1] - 2 \times
     \text{padding}[1] + \text{dilation}[1]           \times
     (\text{kernel\_size}[1] - 1) + \text{output\_padding}[1] + 1

     W_{out} = (W_{in} - 1) \times \text{stride}[2] - 2 \times
     \text{padding}[2] + \text{dilation}[2]           \times
     (\text{kernel\_size}[2] - 1) + \text{output\_padding}[2] + 1

Variables:
      * weight (Tensor) -- the learnable weights of the module
        of shape (\text{in_channels},
        \frac{\text{out_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{out} *
        \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{out} *
    \prod_{i=0}^{2}\text{kernel\_size}[i]}

Examples:
  >>> # With square kernels and equal stride
  >>> m = nn.ConvTranspose3d(16, 33, 3, stride=2)
  >>> # non-square kernels and unequal stride and with padding
  >>> m = nn.ConvTranspose3d(16, 33, (3, 5, 2), stride=(2, 1, 1), padding=(0, 4, 2))
  >>> input = torch.randn(20, 16, 10, 50, 100)
  >>> output = m(input)


torch.cholesky_inverse
torch.cholesky_inverse(input, upper=False, *, out=None) -> Tensor
Computes the inverse of a symmetric positive-definite matrix A
   using its Cholesky factor u: returns matrix "inv". The inverse is
   computed using LAPACK routines "dpotri" and "spotri" (and the
   corresponding MAGMA routines).
If "upper" is "False", u is lower triangular such that the returned
   tensor is
  inv = (uu^{{T}})^{{-1}}

If "upper" is "True" or not provided, u is upper triangular such
   that the returned tensor is
  inv = (u^T u)^{{-1}}

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.
Parameters:
      * input (Tensor) -- the input tensor A of size (*, n, n),
        consisting of symmetric positive-definite matrices where * is
        zero or more batch dimensions.


zero or more batch dimensions.
  * **upper** (*bool**, **optional*) -- flag that indicates
    whether to return a upper or lower triangular matrix. Default:
    False

Keyword Arguments:
      out (Tensor, optional) -- the output tensor for inv
Example:
  >>> a = torch.randn(3, 3)
  >>> a = torch.mm(a, a.t()) + 1e-05 * torch.eye(3) # make symmetric positive definite
  >>> u = torch.linalg.cholesky(a)
  >>> a
  tensor([[  0.9935,  -0.6353,   1.5806],
          [ -0.6353,   0.8769,  -1.7183],
          [  1.5806,  -1.7183,  10.6618]])
  >>> torch.cholesky_inverse(u)
  tensor([[ 1.9314,  1.2251, -0.0889],
          [ 1.2251,  2.4439,  0.2122],
          [-0.0889,  0.2122,  0.1412]])
  >>> a.inverse()
  tensor([[ 1.9314,  1.2251, -0.0889],
          [ 1.2251,  2.4439,  0.2122],
          [-0.0889,  0.2122,  0.1412]])
  >>> a = torch.randn(3, 2, 2) # Example for batched input


a = a @ a.mT + 1e-03 # make symmetric positive-definite
      >>> l = torch.linalg.cholesky(a)
      >>> z = l @ l.mT
      >>> torch.dist(z, a)
      tensor(3.5894e-07)


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


GroupNorm
class torch.nn.GroupNorm(num_groups, num_channels, eps=1e-05, affine=True, device=None, dtype=None)
Applies Group Normalization over a mini-batch of inputs as
   described in the paper Group Normalization
  y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + \epsilon}}
  * \gamma + \beta

The input channels are separated into "num_groups" groups, each
   containing "num_channels / num_groups" channels. "num_channels"
   must be divisible by "num_groups". The mean and standard-deviation
   are calculated separately over the each group. \gamma and \beta are
   learnable per-channel affine transform parameter vectors of size
   "num_channels" if "affine" is "True". The standard-deviation is
   calculated via the biased estimator, equivalent to
   torch.var(input, unbiased=False).
This layer uses statistics computed from input data in both
   training and evaluation modes.
Parameters:
      * num_groups (int) -- number of groups to separate the


channels into
  * **num_channels** (*int*) -- number of channels expected in
    input

  * **eps** (*float*) -- a value added to the denominator for
    numerical stability. Default: 1e-5

  * **affine** (*bool*) -- a boolean value that when set to
    "True", this module has learnable per-channel affine
    parameters initialized to ones (for weights) and zeros (for
    biases). Default: "True".

Shape:
      * Input: (N, C, *) where C=\text{num_channels}
  * Output: (N, C, *) (same shape as input)

Examples:
  >>> input = torch.randn(20, 6, 10, 10)
  >>> # Separate 6 channels into 3 groups
  >>> m = nn.GroupNorm(3, 6)
  >>> # Separate 6 channels into 6 groups (equivalent with InstanceNorm)
  >>> m = nn.GroupNorm(6, 6)
  >>> # Put all 6 channels into a single group (equivalent with LayerNorm)
  >>> m = nn.GroupNorm(1, 6)
  >>> # Activating the module
  >>> output = m(input)


torch.cuda.caching_allocator_alloc
torch.cuda.caching_allocator_alloc(size, device=None, stream=None)
Performs a memory allocation using the CUDA memory allocator.
Memory is allocated for a given device and a stream, this function
   is intended to be used for interoperability with other frameworks.
   Allocated memory is released through "caching_allocator_delete()".
Parameters:
      * size (int) -- number of bytes to be allocated.
  * **device** (*torch.device** or **int**, **optional*) --
    selected device. If it is "None" the default CUDA device is
    used.

  * **stream** (*torch.cuda.Stream** or **int**, **optional*) --
    selected stream. If is "None" then the default stream for the
    selected device is used.

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


BatchNorm1d
class torch.nn.BatchNorm1d(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)
Applies Batch Normalization over a 2D or 3D input as described in
   the paper Batch Normalization: Accelerating Deep Network Training
   by Reducing Internal Covariate Shift .
  y = \frac{x - \mathrm{E}[x]}{\sqrt{\mathrm{Var}[x] + \epsilon}}
  * \gamma + \beta

The mean and standard-deviation are calculated per-dimension over
   the mini-batches and \gamma and \beta are learnable parameter
   vectors of size C (where C is the number of features or
   channels of the input). By default, the elements of \gamma are set
   to 1 and the elements of \beta are set to 0. The standard-deviation
   is calculated via the biased estimator, equivalent to
   torch.var(input, unbiased=False).
Also by default, during training this layer keeps running estimates
   of its computed mean and variance, which are then used for


normalization during evaluation. The running estimates are kept
   with a default "momentum" of 0.1.
If "track_running_stats" is set to "False", this layer then does
   not keep running estimates, and batch statistics are instead used
   during evaluation time as well.
Note:
 This "momentum" argument is different from one used in optimizer
 classes and the conventional notion of momentum. Mathematically,
 the update rule for running statistics here is \hat{x}_\text{new}
 = (1 - \text{momentum}) \times \hat{x} + \text{momentum} \times
 x_t, where \hat{x} is the estimated statistic and x_t is the new
 observed value.

Because the Batch Normalization is done over the C dimension,
   computing statistics on (N, L) slices, it's common terminology to
   call this Temporal Batch Normalization.
Parameters:
      * num_features (int) -- number of features or channels C
        of the input
  * **eps** (*float*) -- a value added to the denominator for


numerical stability. Default: 1e-5
  * **momentum** (*float*) -- the value used for the running_mean
    and running_var computation. Can be set to "None" for
    cumulative moving average (i.e. simple average). Default: 0.1

  * **affine** (*bool*) -- a boolean value that when set to
    "True", this module has learnable affine parameters. Default:
    "True"

  * **track_running_stats** (*bool*) -- a boolean value that when
    set to "True", this module tracks the running mean and
    variance, and when set to "False", this module does not track
    such statistics, and initializes statistics buffers
    "running_mean" and "running_var" as "None". When these buffers
    are "None", this module always uses batch statistics. in both
    training and eval modes. Default: "True"

Shape:
      * Input: (N, C) or (N, C, L), where N is the batch size, C is
        the number of features or channels, and L is the sequence
        length


length
  * Output: (N, C) or (N, C, L) (same shape as input)

Examples:
  >>> # With Learnable Parameters
  >>> m = nn.BatchNorm1d(100)
  >>> # Without Learnable Parameters
  >>> m = nn.BatchNorm1d(100, affine=False)
  >>> input = torch.randn(20, 100)
  >>> output = m(input)


torch.nn.functional.hardsigmoid
torch.nn.functional.hardsigmoid(input, inplace=False)
Applies the element-wise function
  \text{Hardsigmoid}(x) = \begin{cases}     0 & \text{if~} x \le
  -3, \\     1 & \text{if~} x \ge +3, \\     x / 6 + 1 / 2 &
  \text{otherwise} \end{cases}

Parameters:
      inplace (bool) -- If set to "True", will do this operation
      in-place. Default: "False"
Return type:
      Tensor
See "Hardsigmoid" for more details.


torch.cuda.synchronize
torch.cuda.synchronize(device=None)
Waits for all kernels in all streams on a CUDA device to complete.
Parameters:
      device (torch.device or int, optional) -- device
      for which to synchronize. It uses the current device, given by
      "current_device()", if "device" is "None" (default).


torch.Tensor.logical_xor_
Tensor.logical_xor_() -> Tensor
In-place version of "logical_xor()"


torch.addcmul
torch.addcmul(input, tensor1, tensor2, *, value=1, out=None) -> Tensor
Performs the element-wise multiplication of "tensor1" by "tensor2",
   multiplies the result by the scalar "value" and adds it to "input".
  \text{out}_i = \text{input}_i + \text{value} \times
  \text{tensor1}_i \times \text{tensor2}_i

The shapes of "tensor", "tensor1", and "tensor2" must be
   broadcastable.
For inputs of type FloatTensor or DoubleTensor, "value" must be
   a real number, otherwise an integer.
Parameters:
      * input (Tensor) -- the tensor to be added
  * **tensor1** (*Tensor*) -- the tensor to be multiplied

  * **tensor2** (*Tensor*) -- the tensor to be multiplied

Keyword Arguments:
      * value (Number, optional) -- multiplier for tensor1
        .* tensor2
  * **out** (*Tensor**, **optional*) -- the output tensor.

Example:
  >>> t = torch.randn(1, 3)
  >>> t1 = torch.randn(3, 1)
  >>> t2 = torch.randn(1, 3)


t2 = torch.randn(1, 3)
      >>> torch.addcmul(t, t1, t2, value=0.1)
      tensor([[-0.8635, -0.6391,  1.6174],
              [-0.7617, -0.5879,  1.7388],
              [-0.8353, -0.6249,  1.6511]])


torch.Tensor.multiply
Tensor.multiply(value) -> Tensor
See "torch.multiply()".


MovingAverageMinMaxObserver
class torch.quantization.observer.MovingAverageMinMaxObserver(averaging_constant=0.01, dtype=torch.quint8, qscheme=torch.per_tensor_affine, reduce_range=False, quant_min=None, quant_max=None, eps=1.1920928955078125e-07, **kwargs)
Observer module for computing the quantization parameters based on
   the moving average of the min and max values.
This observer computes the quantization parameters based on the
   moving averages of minimums and maximums of the incoming tensors.
   The module records the average minimum and maximum of incoming
   tensors, and uses this statistic to compute the quantization
   parameters.
Parameters:
      * averaging_constant -- Averaging constant for min/max.
  * **dtype** -- dtype argument to the *quantize* node needed to
    implement the reference model spec.

  * **qscheme** -- Quantization scheme to be used

  * **reduce_range** -- Reduces the range of the quantized data


type by 1 bit
  * **quant_min** -- Minimum quantization value. If unspecified,
    it will follow the 8-bit setup.

  * **quant_max** -- Maximum quantization value. If unspecified,
    it will follow the 8-bit setup.

  * **eps** (*Tensor*) -- Epsilon value for float32, Defaults to
    *torch.finfo(torch.float32).eps*.

The moving average min/max is computed as follows
  \begin{array}{ll}         x_\text{min} = \begin{cases}
  \min(X) & \text{if~}x_\text{min} = \text{None} \\             (1
  - c) x_\text{min} + c \min(X) & \text{otherwise}
  \end{cases}\\         x_\text{max} = \begin{cases}
  \max(X) & \text{if~}x_\text{max} = \text{None} \\             (1
  - c) x_\text{max} + c \max(X) & \text{otherwise}
  \end{cases}\\ \end{array}

where x_\text{min/max} is the running average min/max, X is is the
   incoming tensor, and c is the "averaging_constant".
The scale and zero point are then computed as in "MinMaxObserver".
Note:


Note:
 Only works with "torch.per_tensor_affine" quantization scheme.

Note:
 If the running minimum equals to the running maximum, the scale
 and zero_point are set to 1.0 and 0.


torch.cuda.get_gencode_flags
torch.cuda.get_gencode_flags()
Returns NVCC gencode flags this library was compiled with.
Return type:
      str


Softsign
class torch.nn.Softsign
Applies the element-wise function:
  \text{SoftSign}(x) = \frac{x}{ 1 + |x|}

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

[image]
Examples:
  >>> m = nn.Softsign()
  >>> input = torch.randn(2)
  >>> output = m(input)


torch.Tensor.is_shared
Tensor.is_shared()
Checks if tensor is in shared memory.
This is always "True" for CUDA tensors.


torch.Tensor.topk
Tensor.topk(k, dim=None, largest=True, sorted=True)
See "torch.topk()"


torch.nn.utils.prune.remove
torch.nn.utils.prune.remove(module, name)
Removes the pruning reparameterization from a module and the
   pruning method from the forward hook. 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!

Parameters:
      * module (nn.Module) -- module containing the tensor to
        prune
  * **name** (*str*) -- parameter name within "module" on which
    pruning will act.

-[ Examples ]-

m = random_unstructured(nn.Linear(5, 7), name='weight', amount=0.2)
m = remove(m, name='weight')


torch.Tensor.q_per_channel_scales
Tensor.q_per_channel_scales() -> Tensor
Given a Tensor quantized by linear (affine) per-channel
   quantization, returns a Tensor of scales of the underlying
   quantizer. It has the number of elements that matches the
   corresponding dimensions (from q_per_channel_axis) of the tensor.


torch.take_along_dim
torch.take_along_dim(input, indices, dim, *, out=None) -> Tensor
Selects values from "input" at the 1-dimensional indices from
   "indices" along the given "dim".
Functions that return indices along a dimension, like
   "torch.argmax()" and "torch.argsort()", are designed to work with
   this function. See the examples below.
Note:
 This function is similar to NumPy's *take_along_axis*. See also
 "torch.gather()".

Parameters:
      * input (Tensor) -- the input tensor.
  * **indices** (*tensor*) -- the indices into "input". Must have
    long dtype.

  * **dim** (*int*) -- dimension to select along.

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> t = torch.tensor([[10, 30, 20], [60, 40, 50]])
  >>> max_idx = torch.argmax(t)
  >>> torch.take_along_dim(t, max_idx)
  tensor([60])
  >>> sorted_idx = torch.argsort(t, dim=1)


sorted_idx = torch.argsort(t, dim=1)
      >>> torch.take_along_dim(t, sorted_idx, dim=1)
      tensor([[10, 20, 30],
              [40, 50, 60]])


torch.get_rng_state
torch.get_rng_state()
Returns the random number generator state as a torch.ByteTensor.
Return type:
      Tensor