to which to take diagonal. Default: 0.
  * **dim2** (*int**, **optional*) -- second dimension with
    respect to which to take diagonal. Default: 1.

Note:
 To take a batch diagonal, pass in dim1=-2, dim2=-1.

Examples:
  >>> a = torch.randn(3, 3)
  >>> a
  tensor([[-1.0854,  1.1431, -0.1752],
          [ 0.8536, -0.0905,  0.0360],
          [ 0.6927, -0.3735, -0.4945]])

  >>> torch.diagonal(a, 0)
  tensor([-1.0854, -0.0905, -0.4945])

  >>> torch.diagonal(a, 1)
  tensor([ 1.1431,  0.0360])

  >>> x = torch.randn(2, 5, 4, 2)
  >>> torch.diagonal(x, offset=-1, dim1=1, dim2=2)
  tensor([[[-1.2631,  0.3755, -1.5977, -1.8172],
           [-1.1065,  1.0401, -0.2235, -0.7938]],

          [[-1.7325, -0.3081,  0.6166,  0.2335],
           [ 1.0500,  0.7336, -0.3836, -1.1015]]])


MultiLabelMarginLoss
class torch.nn.MultiLabelMarginLoss(size_average=None, reduce=None, reduction='mean')
Creates a criterion that optimizes a multi-class multi-
   classification hinge loss (margin-based loss) between input x (a 2D
   mini-batch Tensor) and output y (which is a 2D Tensor of target
   class indices). For each sample in the mini-batch:
  \text{loss}(x, y) = \sum_{ij}\frac{\max(0, 1 - (x[y[j]] -
  x[i]))}{\text{x.size}(0)}

where x \in \left{0, \; \cdots , \; \text{x.size}(0) - 1\right},
   y \in \left{0, \; \cdots , \; \text{y.size}(0) - 1\right}, 0 \leq
   y[j] \leq \text{x.size}(0)-1, and i \neq y[j] for all i and j.
y and x must have the same size.
The criterion only considers a contiguous block of non-negative
   targets that starts at the front.
This allows for different samples to have variable amounts of
   target classes.
Parameters:
      * size_average (bool, optional) -- Deprecated (see


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

  * **reduction** (*str**, **optional*) -- Specifies the reduction
    to apply to the output: "'none'" | "'mean'" | "'sum'".
    "'none'": no reduction will be applied, "'mean'": the sum of
    the output will be divided by the number of elements in the
    output, "'sum'": the output will be summed. Note:


"size_average" and "reduce" are in the process of being
        deprecated, and in the meantime, specifying either of those
        two args will override "reduction". Default: "'mean'"
Shape:
      * Input: (C) or (N, C) where N is the batch size and C is
        the number of classes.
  * Target: (C) or (N, C), label targets padded by -1 ensuring
    same shape as the input.

  * Output: scalar. If "reduction" is "'none'", then (N).

Examples:
  >>> loss = nn.MultiLabelMarginLoss()
  >>> x = torch.FloatTensor([[0.1, 0.2, 0.4, 0.8]])
  >>> # for target y, only consider labels 3 and 0, not after label -1
  >>> y = torch.LongTensor([[3, 0, -1, 1]])
  >>> # 0.25 * ((1-(0.1-0.2)) + (1-(0.1-0.4)) + (1-(0.8-0.2)) + (1-(0.8-0.4)))
  >>> loss(x, y)
  tensor(0.85...)


BatchNorm3d
class torch.nn.BatchNorm3d(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)
Applies Batch Normalization over a 5D input (a mini-batch of 3D
   inputs with additional channel dimension) 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 input size). 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, D, H, W) slices, it's common
   terminology to call this Volumetric Batch Normalization or Spatio-
   temporal Batch Normalization.
Parameters:
      * num_features (int) -- C from an expected input of size
        (N, C, D, H, W)


(N, C, D, H, W)
  * **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, D, H, W)


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

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


Softshrink
class torch.nn.Softshrink(lambd=0.5)
Applies the soft shrinkage function elementwise:
  \text{SoftShrinkage}(x) = \begin{cases} x - \lambda, & \text{ if
  } x > \lambda \\ x + \lambda, & \text{ if } x < -\lambda \\ 0, &
  \text{ otherwise } \end{cases}

Parameters:
      lambd (float) -- the \lambda (must be no less than zero)
      value for the Softshrink formulation. Default: 0.5
Shape:
      * Input: (*), where * means any number of dimensions.
  * Output: (*), same shape as the input.

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


torch.Tensor.slogdet
Tensor.slogdet()
See "torch.slogdet()"


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


torch.scatter_reduce
torch.scatter_reduce(input, dim, index, src, reduce, *, include_self=True) -> Tensor
Out-of-place version of "torch.Tensor.scatter_reduce_()"


torch.cross
torch.cross(input, other, dim=None, *, out=None) -> Tensor
Returns the cross product of vectors in dimension "dim" of "input"
   and "other".
Supports input of float, double, cfloat and cdouble dtypes. Also
   supports batches of vectors, for which it computes the product
   along the dimension "dim". In this case, the output has the same
   batch dimensions as the inputs.
If "dim" is not given, it defaults to the first dimension found
   with the size 3. Note that this might be unexpected.
See also:
 "torch.linalg.cross()" which requires specifying dim (defaulting
 to -1).

Warning:
 This function may change in a future PyTorch release to match the
 default behaviour in "torch.linalg.cross()". We recommend using
 "torch.linalg.cross()".

Parameters:
      * input (Tensor) -- the input tensor.
  * **other** (*Tensor*) -- the second input tensor

  * **dim** (*int**, **optional*) -- the dimension to take the


cross-product in.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4, 3)
  >>> a
  tensor([[-0.3956,  1.1455,  1.6895],
          [-0.5849,  1.3672,  0.3599],
          [-1.1626,  0.7180, -0.0521],
          [-0.1339,  0.9902, -2.0225]])
  >>> b = torch.randn(4, 3)
  >>> b
  tensor([[-0.0257, -1.4725, -1.2251],
          [-1.1479, -0.7005, -1.9757],
          [-1.3904,  0.3726, -1.1836],
          [-0.9688, -0.7153,  0.2159]])
  >>> torch.cross(a, b, dim=1)
  tensor([[ 1.0844, -0.5281,  0.6120],
          [-2.4490, -1.5687,  1.9792],
          [-0.8304, -1.3037,  0.5650],
          [-1.2329,  1.9883,  1.0551]])
  >>> torch.cross(a, b)
  tensor([[ 1.0844, -0.5281,  0.6120],
          [-2.4490, -1.5687,  1.9792],
          [-0.8304, -1.3037,  0.5650],
          [-1.2329,  1.9883,  1.0551]])


torch.Tensor.sinc_
Tensor.sinc_() -> Tensor
In-place version of "sinc()"


torch.is_inference_mode_enabled
torch.is_inference_mode_enabled()
Returns True if inference mode is currently enabled.


torch.Tensor.lerp_
Tensor.lerp_(end, weight) -> Tensor
In-place version of "lerp()"


torch.Tensor.nanquantile
Tensor.nanquantile(q, dim=None, keepdim=False, *, interpolation='linear') -> Tensor
See "torch.nanquantile()"


torch.cuda.nvtx.range_pop
torch.cuda.nvtx.range_pop()
Pops a range off of a stack of nested range spans.  Returns the
   zero-based depth of the range that is ended.


torch.dequantize
torch.dequantize(tensor) -> Tensor
Returns an fp32 Tensor by dequantizing a quantized Tensor
Parameters:
      tensor (Tensor) -- A quantized Tensor
torch.dequantize(tensors) -> sequence of Tensors
Given a list of quantized Tensors, dequantize them and return a
   list of fp32 Tensors
Parameters:
      tensors (sequence of Tensors) -- A list of quantized
      Tensors


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


LinearReLU
class torch.ao.nn.intrinsic.quantized.LinearReLU(in_features, out_features, bias=True, dtype=torch.qint8)
A LinearReLU module fused from Linear and ReLU modules
We adopt the same interface as "torch.ao.nn.quantized.Linear".
Variables:
      torch.ao.nn.quantized.Linear (Same as) --
Examples:
  >>> m = nn.intrinsic.LinearReLU(20, 30)
  >>> input = torch.randn(128, 20)
  >>> output = m(input)
  >>> print(output.size())
  torch.Size([128, 30])


FakeQuantizeBase
class torch.quantization.fake_quantize.FakeQuantizeBase
Base fake quantize module Any fake quantize implementation should
   derive from this class.
Concrete fake quantize module should follow the same API. In
   forward, they will update the statistics of the observed Tensor and
   fake quantize the input. They should also provide a
   calculate_qparams function that computes the quantization
   parameters given the collected statistics.


torch.optim.Optimizer.add_param_group
Optimizer.add_param_group(param_group)
Add a param group to the "Optimizer" s param_groups.
This can be useful when fine tuning a pre-trained network as frozen
   layers can be made trainable and added to the "Optimizer" as
   training progresses.
Parameters:
      param_group (dict) -- Specifies what Tensors should be
      optimized along with group specific optimization options.


ConvBnReLU2d
class torch.ao.nn.intrinsic.ConvBnReLU2d(conv, bn, relu)
This is a sequential container which calls the Conv 2d, Batch Norm
   2d, and ReLU modules. During quantization this will be replaced
   with the corresponding fused module.


torch.Tensor.new_ones
Tensor.new_ones(size, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor
Returns a Tensor of size "size" filled with "1". By default, the
   returned Tensor has the same "torch.dtype" and "torch.device" as
   this tensor.
Parameters:
      size (int...) -- a list, tuple, or "torch.Size" of
      integers defining the shape of the output tensor.
Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired type of
        returned tensor. Default: if None, same "torch.dtype" as this
        tensor.
  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if None, same "torch.device" as this
    tensor.

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

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


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

Example:
  >>> tensor = torch.tensor((), dtype=torch.int32)
  >>> tensor.new_ones((2, 3))
  tensor([[ 1,  1,  1],
          [ 1,  1,  1]], dtype=torch.int32)


AdaptiveMaxPool3d
class torch.nn.AdaptiveMaxPool3d(output_size, return_indices=False)
Applies a 3D adaptive max pooling over an input signal composed of
   several input planes.
The output is of size D_{out} \times H_{out} \times W_{out}, for
   any input size. The number of output features is equal to the
   number of input planes.
Parameters:
      * output_size (Union[int, None,
        Tuple[Optional[int], Optional[int],
        Optional[int]]]) -- the target output size of the
        image of the form D_{out} \times H_{out} \times W_{out}. Can
        be a tuple (D_{out}, H_{out}, W_{out}) or a single D_{out} for
        a cube D_{out} \times D_{out} \times D_{out}. D_{out}, H_{out}
        and W_{out} can be either a "int", or "None" which means the
        size will be the same as that of the input.
  * **return_indices** (*bool*) -- if "True", will return the


indices along with the outputs. Useful to pass to
        nn.MaxUnpool3d. Default: "False"
Shape:
      * Input: (N, C, D_{in}, H_{in}, W_{in}) or (C, D_{in}, H_{in},
        W_{in}).
  * Output: (N, C, D_{out}, H_{out}, W_{out}) or (C, D_{out},
    H_{out}, W_{out}), where (D_{out}, H_{out},
    W_{out})=\text{output\_size}.

-[ Examples ]-

target output size of 5x7x9
m = nn.AdaptiveMaxPool3d((5, 7, 9))
input = torch.randn(1, 64, 8, 9, 10)
output = m(input)
target output size of 7x7x7 (cube)
m = nn.AdaptiveMaxPool3d(7)
input = torch.randn(1, 64, 10, 9, 8)
output = m(input)
target output size of 7x9x8
m = nn.AdaptiveMaxPool3d((7, None, None))
input = torch.randn(1, 64, 10, 9, 8)
output = m(input)


torch.optim.Optimizer.zero_grad
Optimizer.zero_grad(set_to_none=False)
Sets the gradients of all optimized "torch.Tensor" s to zero.
Parameters:
      set_to_none (bool) -- instead of setting to zero, set the
      grads to None. This will in general have lower memory footprint,
      and can modestly improve performance. However, it changes
      certain behaviors. For example: 1. When the user tries to access
      a gradient and perform manual ops on it, a None attribute or a
      Tensor full of 0s will behave differently. 2. If the user
      requests "zero_grad(set_to_none=True)" followed by a backward
      pass, ".grad"s are guaranteed to be None for params that did not
      receive a gradient. 3. "torch.optim" optimizers have a different
      behavior if the gradient is 0 or None (in one case it does the
      step with a gradient of 0 and in the other it skips the step
      altogether).


torch.nn.modules.module.register_module_backward_hook
torch.nn.modules.module.register_module_backward_hook(hook)
Registers a backward hook common to all the modules.
This function is deprecated in favor of
   "torch.nn.modules.module.register_module_full_backward_hook()" and
   the behavior of this function will change in future versions.
Returns:
      a handle that can be used to remove the added hook by calling
      "handle.remove()"
Return type:
      "torch.utils.hooks.RemovableHandle"


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


ConstantPad3d
class torch.nn.ConstantPad3d(padding, value)
Pads the input tensor boundaries with a constant value.
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 6-tuple,
      uses (\text{padding_left}, \text{padding_right},
      \text{padding_top}, \text{padding_bottom},
      \text{padding_front}, \text{padding_back})
Shape:
      * Input: (N, C, D_{in}, H_{in}, W_{in}) or (C, D_{in}, H_{in},
        W_{in}).
  * Output: (N, C, D_{out}, H_{out}, W_{out}) or (C, D_{out},
    H_{out}, W_{out}), where

    D_{out} = D_{in} + \text{padding\_front} +
    \text{padding\_back}

    H_{out} = H_{in} + \text{padding\_top} +
    \text{padding\_bottom}

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

Examples:
  >>> m = nn.ConstantPad3d(3, 3.5)


m = nn.ConstantPad3d(3, 3.5)
      >>> input = torch.randn(16, 3, 10, 20, 30)
      >>> output = m(input)
      >>> # using different paddings for different sides
      >>> m = nn.ConstantPad3d((3, 3, 6, 6, 0, 1), 3.5)
      >>> output = m(input)


torch.nn.utils.weight_norm
torch.nn.utils.weight_norm(module, name='weight', dim=0)
Applies weight normalization to a parameter in the given module.
  \mathbf{w} = g \dfrac{\mathbf{v}}{\|\mathbf{v}\|}

Weight normalization is a reparameterization that decouples the
   magnitude of a weight tensor from its direction. This replaces the
   parameter specified by "name" (e.g. "'weight'") with two
   parameters: one specifying the magnitude (e.g. "'weight_g'") and
   one specifying the direction (e.g. "'weight_v'"). Weight
   normalization is implemented via a hook that recomputes the weight
   tensor from the magnitude and direction before every "forward()"
   call.
By default, with "dim=0", the norm is computed independently per
   output channel/plane. To compute a norm over the entire weight
   tensor, use "dim=None".
See https://arxiv.org/abs/1602.07868
Parameters:
      * module (Module) -- containing module


name (str, optional) -- name of weight parameter

dim (int, optional) -- dimension over which to
    compute the norm

Returns:
      The original module with the weight norm hook
Return type:
      T_module
Example:
  >>> m = weight_norm(nn.Linear(20, 40), name='weight')
  >>> m
  Linear(in_features=20, out_features=40, bias=True)
  >>> m.weight_g.size()
  torch.Size([40, 1])
  >>> m.weight_v.size()
  torch.Size([40, 20])


torch.cuda.make_graphed_callables
torch.cuda.make_graphed_callables(callables, sample_args, num_warmup_iters=3, allow_unused_input=False)
Accepts callables (functions or "nn.Module"s) and returns graphed
   versions.
Each graphed callable's forward pass runs its source callable's
   forward CUDA work as a CUDA graph inside a single autograd node.
The graphed callable's forward pass also appends a backward node to
   the autograd graph. During backward, this node runs the callable's
   backward work as a CUDA graph.
Therefore, each graphed callable should be a drop-in replacement
   for its source callable in an autograd-enabled training loop.
See Partial-network capture for detailed use and constraints.
If you pass a tuple of several callables, their captures will use
   the same memory pool. See Graph memory management for when this is
   appropriate.
Parameters:
      * callables (torch.nn.Module or Python function*, or


*tuple of these) -- Callable or callables to graph. See
        Graph memory management for when passing a tuple of callables
        is appropriate.  If you pass a tuple of callables, their order
        in the tuple must be the same order they'll run in the live
        workload.
  * **sample_args** (*tuple of Tensors**, or **tuple of tuples of
    Tensors*) -- Samples args for each callable. If a single
    callable was passed, "sample_args" must be a single tuple of
    argument Tensors. If a tuple of callables was passed,
    "sample_args" must be tuple of tuples of argument Tensors.

  * **num_warmup_iters** (*int*) -- The number of warmup
    iterations. Currently, "DataDistributedParallel" needs 11
    iterations for warm up. Default: "3".

  * **allow_unused_input** (*bool*) -- If False, specifying inputs
    that were not used when computing outputs (and therefore their
    grad is always zero) is an error. Defaults to False.

Note:


Note:
 The "requires_grad" state of each Tensor in "sample_args" must
 match the state that's expected for the corresponding real input
 in the training loop.

Warning:
 This API is in beta and may change in future releases.

Warning:
 "sample_args" for each callable must contain only Tensors. Other
 types are not allowed.

Warning:
 Returned callables do not support higher order differentiation
 (e.g., double backward).

Warning:
 In any "Module" passed to "make_graphed_callables()", only
 parameters may be trainable. Buffers must have
 "requires_grad=False".

Warning:
 After you pass a "torch.nn.Module" through
 "make_graphed_callables()", you may not add or remove any of that
 Module's parameters or buffers.

Warning:
 "torch.nn.Module"s passed to "make_graphed_callables()" must not
 have module hooks registered on them at the time they are passed.
 However, registering hooks on modules *after* passing them


through "make_graphed_callables()" is allowed.
Warning:
 When running a graphed callable, you must pass its arguments in
 the same order and format they appeared in that callable's
 "sample_args".

Warning:
 The automatic mixed precision is supported in
 "make_graphed_callables()" only with disabled caching. The
 context manager *torch.cuda.amp.autocast()* must have
 *cache_enabled=False*.


torch.nn.utils.spectral_norm
torch.nn.utils.spectral_norm(module, name='weight', n_power_iterations=1, eps=1e-12, dim=None)
Applies spectral normalization to a parameter in the given module.
  \mathbf{W}_{SN} = \dfrac{\mathbf{W}}{\sigma(\mathbf{W})},
  \sigma(\mathbf{W}) = \max_{\mathbf{h}: \mathbf{h} \ne 0}
  \dfrac{\|\mathbf{W} \mathbf{h}\|_2}{\|\mathbf{h}\|_2}

Spectral normalization stabilizes the training of discriminators
   (critics) in Generative Adversarial Networks (GANs) by rescaling
   the weight tensor with spectral norm \sigma of the weight matrix
   calculated using power iteration method. If the dimension of the
   weight tensor is greater than 2, it is reshaped to 2D in power
   iteration method to get spectral norm. This is implemented via a
   hook that calculates spectral norm and rescales weight before every
   "forward()" call.
See Spectral Normalization for Generative Adversarial Networks .
Parameters:


Parameters:
      * module (nn.Module) -- containing module
  * **name** (*str**, **optional*) -- name of weight parameter

  * **n_power_iterations** (*int**, **optional*) -- number of
    power iterations to calculate spectral norm

  * **eps** (*float**, **optional*) -- epsilon for numerical
    stability in calculating norms

  * **dim** (*int**, **optional*) -- dimension corresponding to
    number of outputs, the default is "0", except for modules that
    are instances of ConvTranspose{1,2,3}d, when it is "1"

Returns:
      The original module with the spectral norm hook
Return type:
      T_module
Note:
 This function has been reimplemented as
 "torch.nn.utils.parametrizations.spectral_norm()" using the new
 parametrization functionality in
 "torch.nn.utils.parametrize.register_parametrization()". Please
 use the newer version. This function will be deprecated in a
 future version of PyTorch.

Example:


future version of PyTorch.
Example:
  >>> m = spectral_norm(nn.Linear(20, 40))
  >>> m
  Linear(in_features=20, out_features=40, bias=True)
  >>> m.weight_u.size()
  torch.Size([40])


torch.roll
torch.roll(input, shifts, dims=None) -> Tensor
Roll the tensor "input" along the given dimension(s). Elements that
   are shifted beyond the last position are re-introduced at the first
   position. If "dims" is None, the tensor will be flattened before
   rolling and then restored to the original shape.
Parameters:
      * input (Tensor) -- the input tensor.
  * **shifts** (*int** or **tuple of ints*) -- The number of
    places by which the elements of the tensor are shifted. If
    shifts is a tuple, dims must be a tuple of the same size, and
    each dimension will be rolled by the corresponding value

  * **dims** (*int** or **tuple of ints*) -- Axis along which to
    roll

Example:
  >>> x = torch.tensor([1, 2, 3, 4, 5, 6, 7, 8]).view(4, 2)
  >>> x
  tensor([[1, 2],
          [3, 4],
          [5, 6],
          [7, 8]])
  >>> torch.roll(x, 1)
  tensor([[8, 1],
          [2, 3],
          [4, 5],


[2, 3],
              [4, 5],
              [6, 7]])
      >>> torch.roll(x, 1, 0)
      tensor([[7, 8],
              [1, 2],
              [3, 4],
              [5, 6]])
      >>> torch.roll(x, -1, 0)
      tensor([[3, 4],
              [5, 6],
              [7, 8],
              [1, 2]])
      >>> torch.roll(x, shifts=(2, 1), dims=(0, 1))
      tensor([[6, 5],
              [8, 7],
              [2, 1],
              [4, 3]])


torch.Tensor.new_tensor
Tensor.new_tensor(data, *, dtype=None, device=None, requires_grad=False, layout=torch.strided, pin_memory=False) -> Tensor
Returns a new Tensor with "data" as the tensor data. By default,
   the returned Tensor has the same "torch.dtype" and "torch.device"
   as this tensor.
Warning:
 "new_tensor()" always copies "data". If you have a Tensor "data"
 and want to avoid a copy, use "torch.Tensor.requires_grad_()" or
 "torch.Tensor.detach()". If you have a numpy array and want to
 avoid a copy, use "torch.from_numpy()".

Warning:
 When data is a tensor *x*, "new_tensor()" reads out 'the data'
 from whatever it is passed, and constructs a leaf variable.
 Therefore "tensor.new_tensor(x)" is equivalent to
 "x.clone().detach()" and "tensor.new_tensor(x,
 requires_grad=True)" is equivalent to
 "x.clone().detach().requires_grad_(True)". The equivalents using
 "clone()" and "detach()" are recommended.


"clone()" and "detach()" are recommended.
Parameters:
      data (array_like) -- The returned Tensor copies "data".
Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired type of
        returned tensor. Default: if None, same "torch.dtype" as this
        tensor.
  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if None, same "torch.device" as this
    tensor.

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

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

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

Example:
  >>> tensor = torch.ones((2,), dtype=torch.int8)
  >>> data = [[0, 1], [2, 3]]


data = [[0, 1], [2, 3]]
      >>> tensor.new_tensor(data)
      tensor([[ 0,  1],
              [ 2,  3]], dtype=torch.int8)


torch.set_printoptions
torch.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, profile=None, sci_mode=None)
Set options for printing. Items shamelessly taken from NumPy
Parameters:
      * precision -- Number of digits of precision for floating
        point output (default = 4).
  * **threshold** -- Total number of array elements which trigger
    summarization rather than full *repr* (default = 1000).

  * **edgeitems** -- Number of array items in summary at beginning
    and end of each dimension (default = 3).

  * **linewidth** -- The number of characters per line for the
    purpose of inserting line breaks (default = 80). Thresholded
    matrices will ignore this parameter.

  * **profile** -- Sane defaults for pretty printing. Can override
    with any of the above options. (any one of *default*, *short*,
    *full*)

  * **sci_mode** -- Enable (True) or disable (False) scientific


notation. If None (default) is specified, the value is defined
        by torch._tensor_str._Formatter. This value is automatically
        chosen by the framework.
Example:
  >>> # Limit the precision of elements
  >>> torch.set_printoptions(precision=2)
  >>> torch.tensor([1.12345])
  tensor([1.12])
  >>> # Limit the number of elements shown
  >>> torch.set_printoptions(threshold=5)
  >>> torch.arange(10)
  tensor([0, 1, 2, ..., 7, 8, 9])
  >>> # Restore defaults
  >>> torch.set_printoptions(profile='default')
  >>> torch.tensor([1.12345])
  tensor([1.1235])
  >>> torch.arange(10)
  tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])


torch.jit.ignore
torch.jit.ignore(drop=False, **kwargs)
This decorator indicates to the compiler that a function or method
   should be ignored and left as a Python function. This allows you to
   leave code in your model that is not yet TorchScript compatible. If
   called from TorchScript, ignored functions will dispatch the call
   to the Python interpreter. Models with ignored functions cannot be
   exported; use "@torch.jit.unused" instead.
Example (using "@torch.jit.ignore" on a method):
  import torch
  import torch.nn as nn

  class MyModule(nn.Module):
      @torch.jit.ignore
      def debugger(self, x):
          import pdb
          pdb.set_trace()

      def forward(self, x):
          x += 10
          # The compiler would normally try to compile `debugger`,
          # but since it is `@ignore`d, it will be left as a call
          # to Python
          self.debugger(x)
          return x


return x
  m = torch.jit.script(MyModule())

  # Error! The call `debugger` cannot be saved since it calls into Python
  m.save("m.pt")

Example (using "@torch.jit.ignore(drop=True)" on a method):
  import torch
  import torch.nn as nn

  class MyModule(nn.Module):
      @torch.jit.ignore(drop=True)
      def training_method(self, x):
          import pdb
          pdb.set_trace()

      def forward(self, x):
          if self.training:
              self.training_method(x)
          return x

  m = torch.jit.script(MyModule())

  # This is OK since `training_method` is not saved, the call is replaced
  # with a `raise`.
  m.save("m.pt")


torch.nn.functional.adaptive_avg_pool2d
torch.nn.functional.adaptive_avg_pool2d(input, output_size)
Applies a 2D adaptive average pooling over an input signal composed
   of several input planes.
See "AdaptiveAvgPool2d" for details and output shape.
Parameters:
      output_size (None) -- the target output size (single
      integer or double-integer tuple)
Return type:
      Tensor


torch.sparse_bsc_tensor
torch.sparse_bsc_tensor(ccol_indices, row_indices, values, size=None, *, dtype=None, device=None, requires_grad=False, check_invariants=None) -> Tensor
Constructs a sparse tensor in BSC (Block Compressed Sparse Column))
   with specified 2-dimensional blocks at the given "ccol_indices" and
   "row_indices". Sparse matrix multiplication operations in BSC
   format are typically faster than that for sparse tensors in COO
   format. Make you have a look at the note on the data type of the
   indices.
Note:
 If the "device" argument is not specified the device of the given
 "values" and indices tensor(s) must match. If, however, the
 argument is specified the input Tensors will be converted to the
 given device and in turn determine the device of the constructed
 sparse tensor.

Parameters:
      * ccol_indices (array_like) -- (B+1)-dimensional array of
        size "(*batchsize, ncolblocks + 1)". The last element of each


batch is the number of non-zeros. This tensor encodes the
        index in values and row_indices depending on where the given
        column starts. Each successive number in the tensor subtracted
        by the number before it denotes the number of elements in a
        given column.
  * **row_indices** (*array_like*) -- Row block co-ordinates of
    each block in values. (B+1)-dimensional tensor with the same
    length as values.

  * **values** (*array_list*) -- Initial blocks for the tensor.
    Can be a list, tuple, NumPy "ndarray", and other types that
    represents a (1 + 2 + K)-dimensional tensor where "K" is the
    number of dense dimensions.

  * **size** (list, tuple, "torch.Size", optional) -- Size of the
    sparse tensor: "(*batchsize, nrows * blocksize[0], ncols *
    blocksize[1], *densesize)" If not provided, the size will be
    inferred as the minimum size big enough to hold all non-zero
    blocks.

Keyword Arguments:


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

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

  * **check_invariants** (*bool**, **optional*) -- If sparse
    tensor invariants are checked. Default: as returned by
    "torch.sparse.check_sparse_tensor_invariants.is_enabled()",
    initially False.

Example::
      >>> ccol_indices = [0, 1, 2]
      >>> row_indices = [0, 1]


row_indices = [0, 1]
      >>> values = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
      >>> torch.sparse_bsc_tensor(torch.tensor(ccol_indices, dtype=torch.int64),
      ...                         torch.tensor(row_indices, dtype=torch.int64),
      ...                         torch.tensor(values), dtype=torch.double)
      tensor(ccol_indices=tensor([0, 1, 2]),
             row_indices=tensor([0, 1]),
             values=tensor([[[1., 2.],
                             [3., 4.]],
                            [[5., 6.],
                             [7., 8.]]]), size=(2, 2), nnz=2, dtype=torch.float64,
             layout=torch.sparse_bsc)


LSTM
class torch.nn.LSTM(args, *kwargs)
Applies a multi-layer long short-term memory (LSTM) RNN to an input
   sequence.
For each element in the input sequence, each layer computes the
   following function:
  \begin{array}{ll} \\     i_t = \sigma(W_{ii} x_t + b_{ii} +
  W_{hi} h_{t-1} + b_{hi}) \\     f_t = \sigma(W_{if} x_t + b_{if}
  + W_{hf} h_{t-1} + b_{hf}) \\     g_t = \tanh(W_{ig} x_t +
  b_{ig} + W_{hg} h_{t-1} + b_{hg}) \\     o_t = \sigma(W_{io} x_t
  + b_{io} + W_{ho} h_{t-1} + b_{ho}) \\     c_t = f_t \odot
  c_{t-1} + i_t \odot g_t \\     h_t = o_t \odot \tanh(c_t) \\
  \end{array}

where h_t is the hidden state at time t, c_t is the cell state at
   time t, x_t is the input at time t, h_{t-1} is the hidden state
   of the layer at time t-1 or the initial hidden state at time 0,
   and i_t, f_t, g_t, o_t are the input, forget, cell, and output
   gates, respectively. \sigma is the sigmoid function, and \odot is
   the Hadamard product.


the Hadamard product.
In a multilayer LSTM, the input x^{(l)}_t of the l -th layer (l >=
   2) is the hidden state h^{(l-1)}_t of the previous layer multiplied
   by dropout \delta^{(l-1)}_t where each \delta^{(l-1)}_t is a
   Bernoulli random variable which is 0 with probability "dropout".
If "proj_size > 0" is specified, LSTM with projections will be
   used. This changes the LSTM cell in the following way. First, the
   dimension of h_t will be changed from "hidden_size" to "proj_size"
   (dimensions of W_{hi} will be changed accordingly). Second, the
   output hidden state of each layer will be multiplied by a learnable
   projection matrix: h_t = W_{hr}h_t. Note that as a consequence of
   this, the output of LSTM network will be of different shape as
   well. See Inputs/Outputs sections below for exact dimensions of all
   variables. You can find more details in
   https://arxiv.org/abs/1402.1128.
Parameters:
      * input_size -- The number of expected features in the input


x
  * **hidden_size** -- The number of features in the hidden state
    *h*

  * **num_layers** -- Number of recurrent layers. E.g., setting
    "num_layers=2" would mean stacking two LSTMs together to form
    a *stacked LSTM*, with the second LSTM taking in outputs of
    the first LSTM and computing the final results. Default: 1

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

  * **batch_first** -- If "True", then the input and output
    tensors are provided as *(batch, seq, feature)* instead of
    *(seq, batch, feature)*. Note that this does not apply to
    hidden or cell states. See the Inputs/Outputs sections below
    for details.  Default: "False"

  * **dropout** -- If non-zero, introduces a *Dropout* layer on
    the outputs of each LSTM layer except the last layer, with
    dropout probability equal to "dropout". Default: 0


bidirectional -- If "True", becomes a bidirectional LSTM.
        Default: "False"

proj_size -- If "> 0", will use LSTM with projections of
    corresponding size. Default: 0

Inputs: input, (h_0, c_0)
      * input: tensor of shape (L, H_{in}) for unbatched input,
        (L, N, H_{in}) when "batch_first=False" or (N, L, H_{in}) when
        "batch_first=True" containing the features of the input
        sequence.  The input can also be a packed variable length
        sequence. See "torch.nn.utils.rnn.pack_padded_sequence()" or
        "torch.nn.utils.rnn.pack_sequence()" for details.
  * **h_0**: tensor of shape (D * \text{num\_layers}, H_{out}) for
    unbatched input or (D * \text{num\_layers}, N, H_{out})
    containing the initial hidden state for each element in the
    input sequence. Defaults to zeros if (h_0, c_0) is not
    provided.

  * **c_0**: tensor of shape (D * \text{num\_layers}, H_{cell})


for unbatched input or (D * \text{num_layers}, N, H_{cell})
        containing the initial cell state for each element in the
        input sequence. Defaults to zeros if (h_0, c_0) is not
        provided.
  where:

     \begin{aligned}     N ={} & \text{batch size} \\     L ={} &
     \text{sequence length} \\     D ={} & 2 \text{ if
     bidirectional=True otherwise } 1 \\     H_{in} ={} &
     \text{input\_size} \\     H_{cell} ={} & \text{hidden\_size}
     \\     H_{out} ={} & \text{proj\_size if }
     \text{proj\_size}>0 \text{ otherwise hidden\_size} \\
     \end{aligned}

Outputs: output, (h_n, c_n)
      * output: tensor of shape (L, D * H_{out}) for unbatched
        input, (L, N, D * H_{out}) when "batch_first=False" or (N, L,
        D * H_{out}) when "batch_first=True" containing the output
        features (h_t) from the last layer of the LSTM, for each
        t. If a "torch.nn.utils.rnn.PackedSequence" has been given


as the input, the output will also be a packed sequence. When
        "bidirectional=True", output will contain a concatenation of
        the forward and reverse hidden states at each time step in the
        sequence.
  * **h_n**: tensor of shape (D * \text{num\_layers}, H_{out}) for
    unbatched input or (D * \text{num\_layers}, N, H_{out})
    containing the final hidden state for each element in the
    sequence. When "bidirectional=True", *h_n* will contain a
    concatenation of the final forward and reverse hidden states,
    respectively.

  * **c_n**: tensor of shape (D * \text{num\_layers}, H_{cell})
    for unbatched input or (D * \text{num\_layers}, N, H_{cell})
    containing the final cell state for each element in the
    sequence. When "bidirectional=True", *c_n* will contain a
    concatenation of the final forward and reverse cell states,
    respectively.

Variables:


respectively.
Variables:
      * weight_ih_l[k] -- the learnable input-hidden weights of
        the \text{k}^{th} layer (W_ii|W_if|W_ig|W_io), of shape
        (4hidden_size, input_size) for k = 0. Otherwise, the
        shape is (4hidden_size, num_directions * hidden_size). If
        "proj_size > 0" was specified, the shape will be
        (4hidden_size, num_directions * proj_size) for k > 0*
  * **weight_hh_l[k]** -- the learnable hidden-hidden weights of
    the \text{k}^{th} layer *(W_hi|W_hf|W_hg|W_ho)*, of shape
    *(4*hidden_size, hidden_size)*. If "proj_size > 0" was
    specified, the shape will be *(4*hidden_size, proj_size)*.

  * **bias_ih_l[k]** -- the learnable input-hidden bias of the
    \text{k}^{th} layer *(b_ii|b_if|b_ig|b_io)*, of shape
    *(4*hidden_size)*

  * **bias_hh_l[k]** -- the learnable hidden-hidden bias of the
    \text{k}^{th} layer *(b_hi|b_hf|b_hg|b_ho)*, of shape
    *(4*hidden_size)*


(4hidden_size)*
  * **weight_hr_l[k]** -- the learnable projection weights of the
    \text{k}^{th} layer of shape *(proj_size, hidden_size)*. Only
    present when "proj_size > 0" was specified.

  * **weight_ih_l[k]_reverse** -- Analogous to *weight_ih_l[k]*
    for the reverse direction. Only present when
    "bidirectional=True".

  * **weight_hh_l[k]_reverse** -- Analogous to *weight_hh_l[k]*
    for the reverse direction. Only present when
    "bidirectional=True".

  * **bias_ih_l[k]_reverse** -- Analogous to *bias_ih_l[k]* for
    the reverse direction. Only present when "bidirectional=True".

  * **bias_hh_l[k]_reverse** -- Analogous to *bias_hh_l[k]* for
    the reverse direction. Only present when "bidirectional=True".

  * **weight_hr_l[k]_reverse** -- Analogous to *weight_hr_l[k]*
    for the reverse direction. Only present when
    "bidirectional=True" and "proj_size > 0" was specified.

Note:


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

Note:
 For bidirectional LSTMs, forward and backward are directions 0
 and 1 respectively. Example of splitting the output layers when
 "batch_first=False": "output.view(seq_len, batch, num_directions,
 hidden_size)".

Note:
 For bidirectional LSTMs, *h_n* is not equivalent to the last
 element of *output*; the former contains the final forward and
 reverse hidden states, while the latter contains the final
 forward hidden state and the initial reverse hidden state.

Note:
 "batch_first" argument is ignored for unbatched inputs.

Warning:
 There are known non-determinism issues for RNN functions on some
 versions of cuDNN and CUDA. You can enforce deterministic
 behavior by setting the following environment variables:On CUDA
 10.1, set environment variable "CUDA_LAUNCH_BLOCKING=1". This may


affect performance.On CUDA 10.2 or later, set environment
     variable (note the leading colon symbol)
     "CUBLAS_WORKSPACE_CONFIG=:16:8" or
     "CUBLAS_WORKSPACE_CONFIG=:4096:2".See the cuDNN 8 Release Notes
     for more information.
Note:
 If the following conditions are satisfied: 1) cudnn is enabled,
 2) input data is on the GPU 3) input data has dtype
 "torch.float16" 4) V100 GPU is used, 5) input data is not in
 "PackedSequence" format persistent algorithm can be selected to
 improve performance.

Examples:
  >>> rnn = nn.LSTM(10, 20, 2)
  >>> input = torch.randn(5, 3, 10)
  >>> h0 = torch.randn(2, 3, 20)
  >>> c0 = torch.randn(2, 3, 20)
  >>> output, (hn, cn) = rnn(input, (h0, c0))


torch.zeros_like
torch.zeros_like(input, *, dtype=None, layout=None, device=None, requires_grad=False, memory_format=torch.preserve_format) -> Tensor
Returns a tensor filled with the scalar value 0, with the same
   size as "input". "torch.zeros_like(input)" is equivalent to
   "torch.zeros(input.size(), dtype=input.dtype, layout=input.layout,
   device=input.device)".
Warning:
 As of 0.4, this function does not support an "out" keyword. As an
 alternative, the old "torch.zeros_like(input, out=output)" is
 equivalent to "torch.zeros(input.size(), out=output)".

Parameters:
      input (Tensor) -- the size of "input" will determine size
      of the output tensor.
Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned Tensor. Default: if "None", defaults to the dtype
        of "input".
  * **layout** ("torch.layout", optional) -- the desired layout of


returned tensor. Default: if "None", defaults to the layout of
        "input".
  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if "None", defaults to the device of
    "input".

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

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

Example:
  >>> input = torch.empty(2, 3)
  >>> torch.zeros_like(input)
  tensor([[ 0.,  0.,  0.],
          [ 0.,  0.,  0.]])


torch.hsplit
torch.hsplit(input, indices_or_sections) -> List of Tensors
Splits "input", a tensor with one or more dimensions, into multiple
   tensors horizontally according to "indices_or_sections". Each split
   is a view of "input".
If "input" is one dimensional this is equivalent to calling
   torch.tensor_split(input, indices_or_sections, dim=0) (the split
   dimension is zero), and if "input" has two or more dimensions it's
   equivalent to calling torch.tensor_split(input,
   indices_or_sections, dim=1) (the split dimension is 1), except that
   if "indices_or_sections" is an integer it must evenly divide the
   split dimension or a runtime error will be thrown.
This function is based on NumPy's "numpy.hsplit()".
Parameters:
      * input (Tensor) -- tensor to split.
  * **indices_or_sections** (*int** or **list** or **tuple of
    ints*) -- See argument in "torch.tensor_split()".

Example::
      >>> t = torch.arange(16.0).reshape(4,4)
      >>> t


t
      tensor([[ 0.,  1.,  2.,  3.],
              [ 4.,  5.,  6.,  7.],
              [ 8.,  9., 10., 11.],
              [12., 13., 14., 15.]])
      >>> torch.hsplit(t, 2)
      (tensor([[ 0.,  1.],
               [ 4.,  5.],
               [ 8.,  9.],
               [12., 13.]]),
       tensor([[ 2.,  3.],
               [ 6.,  7.],
               [10., 11.],
               [14., 15.]]))
      >>> torch.hsplit(t, [3, 6])
      (tensor([[ 0.,  1.,  2.],
               [ 4.,  5.,  6.],
               [ 8.,  9., 10.],
               [12., 13., 14.]]),
       tensor([[ 3.],
               [ 7.],
               [11.],
               [15.]]),
       tensor([], size=(4, 0)))


torch.Tensor.aminmax
Tensor.aminmax(*, dim=None, keepdim=False) -> (Tensor min, Tensor max)
See "torch.aminmax()"


ConvBn3d
class torch.ao.nn.intrinsic.qat.ConvBn3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=None, padding_mode='zeros', eps=1e-05, momentum=0.1, freeze_bn=False, qconfig=None)
A ConvBn3d module is a module fused from Conv3d and BatchNorm3d,
   attached with FakeQuantize modules for weight, used in quantization
   aware training.
We combined the interface of "torch.nn.Conv3d" and
   "torch.nn.BatchNorm3d".
Similar to "torch.nn.Conv3d", with FakeQuantize modules initialized
   to default.
Variables:
      * freeze_bn --
  * **weight_fake_quant** -- fake quant module for weight


torch.Tensor.retain_grad
Tensor.retain_grad() -> None
Enables this Tensor to have their "grad" populated during
   "backward()". This is a no-op for leaf tensors.


BCELoss
class torch.nn.BCELoss(weight=None, size_average=None, reduce=None, reduction='mean')
Creates a criterion that measures the Binary Cross Entropy between
   the target and the input probabilities:
The unreduced (i.e. with "reduction" set to "'none'") loss can be
   described as:
  \ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = - w_n
  \left[ y_n \cdot \log x_n + (1 - y_n) \cdot \log (1 - x_n)
  \right],

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

This is used for measuring the error of a reconstruction in for
   example an auto-encoder. Note that the targets y should be numbers
   between 0 and 1.
Notice that if x_n is either 0 or 1, one of the log terms would be


mathematically undefined in the above loss equation. PyTorch
   chooses to set \log (0) = -\infty, since \lim_{x\to 0} \log (x) =
   -\infty. However, an infinite term in the loss equation is not
   desirable for several reasons.
For one, if either y_n = 0 or (1 - y_n) = 0, then we would be
   multiplying 0 with infinity. Secondly, if we have an infinite loss
   value, then we would also have an infinite term in our gradient,
   since \lim_{x\to 0} \frac{d}{dx} \log (x) = \infty. This would make
   BCELoss's backward method nonlinear with respect to x_n, and using
   it for things like linear regression would not be straight-forward.
Our solution is that BCELoss clamps its log function outputs to be
   greater than or equal to -100. This way, we can always have a
   finite loss value and a linear backward method.
Parameters:
      * weight (Tensor, optional) -- a manual rescaling
        weight given to the loss of each batch element. If given, has


to be a Tensor of size nbatch.
  * **size_average** (*bool**, **optional*) -- Deprecated (see
    "reduction"). By default, the losses are averaged over each
    loss element in the batch. Note that for some losses, there
    are multiple elements per sample. If the field "size_average"
    is set to "False", the losses are instead summed for each
    minibatch. Ignored when "reduce" is "False". Default: "True"

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

  * **reduction** (*str**, **optional*) -- Specifies the reduction
    to apply to the output: "'none'" | "'mean'" | "'sum'".
    "'none'": no reduction will be applied, "'mean'": the sum of


the output will be divided by the number of elements in the
        output, "'sum'": the output will be summed. Note:
        "size_average" and "reduce" are in the process of being
        deprecated, and in the meantime, specifying either of those
        two args will override "reduction". Default: "'mean'"
Shape:
      * Input: (*), where * means any number of dimensions.
  * Target: (*), same shape as the input.

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

Examples:
  >>> m = nn.Sigmoid()
  >>> loss = nn.BCELoss()
  >>> input = torch.randn(3, requires_grad=True)
  >>> target = torch.empty(3).random_(2)
  >>> output = loss(m(input), target)
  >>> output.backward()


torch.Tensor.outer
Tensor.outer(vec2) -> Tensor
See "torch.outer()".


torch.Tensor.clip
Tensor.clip(min=None, max=None) -> Tensor
Alias for "clamp()".


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


torch.hann_window
torch.hann_window(window_length, periodic=True, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Hann window function.
  w[n] = \frac{1}{2}\ \left[1 - \cos \left( \frac{2 \pi n}{N - 1}
  \right)\right] =         \sin^2 \left( \frac{\pi n}{N - 1}
  \right),

where N is the full window size.
The input "window_length" is a positive integer controlling the
   returned window size. "periodic" flag determines whether the
   returned window trims off the last duplicate value from the
   symmetric window and is ready to be used as a periodic window with
   functions like "torch.stft()". Therefore, if "periodic" is true,
   the N in above formula is in fact \text{window_length} + 1. Also,
   we always have "torch.hann_window(L, periodic=True)" equal to
   "torch.hann_window(L + 1, periodic=False)[:-1])".
Note:
 If "window_length" =1, the returned window contains a single
 value 1.

Parameters:


value 1.
Parameters:
      * window_length (int) -- the size of returned window
  * **periodic** (*bool**, **optional*) -- If True, returns a
    window to be used as periodic function. If False, return a
    symmetric window.

Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned tensor. Default: if "None", uses a global default
        (see "torch.set_default_tensor_type()"). Only floating point
        types are supported.
  * **layout** ("torch.layout", optional) -- the desired layout of
    returned window tensor. Only "torch.strided" (dense layout) is
    supported.

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


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

Returns:
      A 1-D tensor of size (\text{window_length},) containing the
      window
Return type:
      Tensor


fuse_fx
class torch.quantization.quantize_fx.fuse_fx(model, fuse_custom_config=None, backend_config=None)
Fuse modules like conv+bn, conv+bn+relu etc, model must be in eval
   mode. Fusion rules are defined in
   torch.quantization.fx.fusion_pattern.py
Parameters:
      * model (***) -- a torch.nn.Module model
  * **fuse_custom_config** (***) -- custom configurations for
    fuse_fx. See "FuseCustomConfig" for more details

Return type:
      GraphModule
Example:
  from torch.ao.quantization import fuse_fx
  m = Model().eval()
  m = fuse_fx(m)


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

If "left"= False, this function returns the matrix X \in
   \mathbb{K}^{n \times k} that solves the system
  XA = B\mathrlap{\qquad A \in \mathbb{K}^{k \times k}, B \in
  \mathbb{K}^{n \times k}.}

This system of linear equations has one solution if and only if A
   is invertible. This function assumes that A is invertible.
Supports inputs of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if the inputs are batches of
   matrices then the output has the same batch dimensions.


Letting *** be zero or more batch dimensions,

If "A" has shape (, n, n) and "B" has shape (, n) (a batch
     of vectors) or shape (, n, k) (a batch of matrices or
     "multiple right-hand sides"), this function returns X of shape
     (, n) or (, n, k)* respectively.

Otherwise, if "A" has shape (, n, n) and  "B" has shape (n,)
     or (n, k), "B" is broadcasted to have shape (, n) or (, n,
     k)* respectively. This function then returns the solution of the
     resulting batch of systems of linear equations.

Note:
 This function computes *X = *"A"*.inverse() @ *"B" in a faster
 and more numerically stable way than performing the computations
 separately.

Note:
 It is possible to compute the solution of the system XA = B by
 passing the inputs "A" and "B" transposed and transposing the
 output returned by this function.

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


device with the CPU.
See also:
 "torch.linalg.solve_triangular()" computes the solution of a
 triangular system of linear equations with a unique solution.

Parameters:
      * A (Tensor) -- tensor of shape (, n, n)* where *** is
        zero or more batch dimensions.
  * **B** (*Tensor*) -- right-hand side tensor of shape *(*, n)*
    or  *(*, n, k)* or *(n,)* or *(n, k)* according to the rules
    described above

Keyword Arguments:
      * left (bool, optional) -- whether to solve the system
        AX=B or XA = B. Default: True.
  * **out** (*Tensor**, **optional*) -- output tensor. Ignored if
    *None*. Default: *None*.

Raises:
      RuntimeError -- if the "A" matrix is not invertible or any
      matrix in a batched "A"     is not invertible.
Examples:
  >>> A = torch.randn(3, 3)
  >>> b = torch.randn(3)
  >>> x = torch.linalg.solve(A, b)
  >>> torch.allclose(A @ x, b)
  True


torch.allclose(A @ x, b)
      True
      >>> A = torch.randn(2, 3, 3)
      >>> B = torch.randn(2, 3, 4)
      >>> X = torch.linalg.solve(A, B)
      >>> X.shape
      torch.Size([2, 3, 4])
      >>> torch.allclose(A @ X, B)
      True

  >>> A = torch.randn(2, 3, 3)
  >>> b = torch.randn(3, 1)
  >>> x = torch.linalg.solve(A, b) # b is broadcasted to size (2, 3, 1)
  >>> x.shape
  torch.Size([2, 3, 1])
  >>> torch.allclose(A @ x, b)
  True
  >>> b = torch.randn(3)
  >>> x = torch.linalg.solve(A, b) # b is broadcasted to size (2, 3)
  >>> x.shape
  torch.Size([2, 3])
  >>> Ax = A @ x.unsqueeze(-1)
  >>> torch.allclose(Ax, b.unsqueeze(-1).expand_as(Ax))
  True


torch.polar
torch.polar(abs, angle, *, out=None) -> Tensor
Constructs a complex tensor whose elements are Cartesian
   coordinates corresponding to the polar coordinates with absolute
   value "abs" and angle "angle".
  \text{out} = \text{abs} \cdot \cos(\text{angle}) + \text{abs}
  \cdot \sin(\text{angle}) \cdot j

Note:
 *torch.polar* is similar to std::polar and does not compute the
 polar decomposition of a complex tensor like Python's
 *cmath.polar* and SciPy's *linalg.polar* do. The behavior of this
 function is undefined if *abs* is negative or NaN, or if *angle*
 is infinite.

Parameters:
      * abs (Tensor) -- The absolute value the complex tensor.
        Must be float or double.
  * **angle** (*Tensor*) -- The angle of the complex tensor. Must
    be same dtype as "abs".

Keyword Arguments:
      out (Tensor) -- If the inputs are "torch.float32", must be
      "torch.complex64". If the inputs are "torch.float64", must be


"torch.complex128".
Example:
  >>> import numpy as np
  >>> abs = torch.tensor([1, 2], dtype=torch.float64)
  >>> angle = torch.tensor([np.pi / 2, 5 * np.pi / 4], dtype=torch.float64)
  >>> z = torch.polar(abs, angle)
  >>> z
  tensor([(0.0000+1.0000j), (-1.4142-1.4142j)], dtype=torch.complex128)


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


torch.numel
torch.numel(input) -> int
Returns the total number of elements in the "input" tensor.
Parameters:
      input (Tensor) -- the input tensor.
Example:
  >>> a = torch.randn(1, 2, 3, 4, 5)
  >>> torch.numel(a)
  120
  >>> a = torch.zeros(4,4)
  >>> torch.numel(a)
  16


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


torch.lt
torch.lt(input, other, *, out=None) -> Tensor
Computes \text{input} < \text{other} element-wise.
The second argument can be a number or a tensor whose shape is
   broadcastable with the first argument.
Parameters:
      * input (Tensor) -- the tensor to compare
  * **other** (*Tensor** or **float*) -- the tensor or value to
    compare

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Returns:
      A boolean tensor that is True where "input" is less than "other"
      and False elsewhere
Example:
  >>> torch.lt(torch.tensor([[1, 2], [3, 4]]), torch.tensor([[1, 1], [4, 4]]))
  tensor([[False, False], [True, False]])


torch.triu_indices
torch.triu_indices(row, col, offset=0, *, dtype=torch.long, device='cpu', layout=torch.strided) -> Tensor
Returns the indices of the upper triangular part of a "row" by
   "col" matrix in a 2-by-N Tensor, where the first row contains row
   coordinates of all indices and the second row contains column
   coordinates. Indices are ordered based on rows and then columns.
The upper triangular part of the matrix is defined as the elements
   on and above the diagonal.
The argument "offset" controls which diagonal to consider. If
   "offset" = 0, all elements on and above the main diagonal are
   retained. A positive value excludes just as many diagonals above
   the main diagonal, and similarly a negative value includes just as
   many diagonals below the main diagonal. The main diagonal are the
   set of indices \lbrace (i, i) \rbrace for i \in [0, \min{d_{1},
   d_{2}} - 1] where d_{1}, d_{2} are the dimensions of the matrix.
Note:


Note:
 When running on CUDA, "row * col" must be less than 2^{59} to
 prevent overflow during calculation.

Parameters:
      * row ("int") -- number of rows in the 2-D matrix.
  * **col** ("int") -- number of columns in the 2-D matrix.

  * **offset** ("int") -- diagonal offset from the main diagonal.
    Default: if not provided, 0.

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

  * **layout** ("torch.layout", optional) -- currently only
    support "torch.strided".

Example:
  >>> a = torch.triu_indices(3, 3)


a = torch.triu_indices(3, 3)
      >>> a
      tensor([[0, 0, 0, 1, 1, 2],
              [0, 1, 2, 1, 2, 2]])

  >>> a = torch.triu_indices(4, 3, -1)
  >>> a
  tensor([[0, 0, 0, 1, 1, 1, 2, 2, 3],
          [0, 1, 2, 0, 1, 2, 1, 2, 2]])

  >>> a = torch.triu_indices(4, 3, 1)
  >>> a
  tensor([[0, 0, 1],
          [1, 2, 2]])


LazyInstanceNorm1d
class torch.nn.LazyInstanceNorm1d(eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)
A "torch.nn.InstanceNorm1d" module with lazy initialization of the
   "num_features" argument of the "InstanceNorm1d" that is inferred
   from the "input.size(1)". The attributes that will be lazily
   initialized are weight, bias, running_mean and running_var.
Check the "torch.nn.modules.lazy.LazyModuleMixin" for further
   documentation on lazy modules and their limitations.
Parameters:
      * num_features -- C from an expected input of size (N, C, L)
        or (C, L)
  * **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. Default: 0.1

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


initialized the same way as done for batch normalization.
        Default: "False".
  * **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 always uses batch statistics in both
    training and eval modes. Default: "False"

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

cls_to_become
  alias of "InstanceNorm1d"


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


torch.fake_quantize_per_channel_affine
torch.fake_quantize_per_channel_affine(input, scale, zero_point, quant_min, quant_max) -> Tensor
Returns a new tensor with the data in "input" fake quantized per
   channel using "scale", "zero_point", "quant_min" and "quant_max",
   across the channel specified by "axis".
  \text{output} = min(     \text{quant\_max},     max(
  \text{quant\_min},         \text{std::nearby\_int}(\text{input}
  / \text{scale}) + \text{zero\_point}     ) )

Parameters:
      * input (Tensor) -- the input value(s), in "torch.float32"
  * **scale** (*Tensor*) -- quantization scale, per channel in
    "torch.float32"

  * **zero_point** (*Tensor*) -- quantization zero_point, per
    channel in "torch.int32" or "torch.half" or "torch.float32"

  * **axis** (*int32*) -- channel axis

  * **quant_min** (*int64*) -- lower bound of the quantized domain


quant_max (int64) -- upper bound of the quantized domain

Returns:
      A newly fake_quantized per channel "torch.float32" tensor
Return type:
      Tensor
Example:
  >>> x = torch.randn(2, 2, 2)
  >>> x
  tensor([[[-0.2525, -0.0466],
           [ 0.3491, -0.2168]],

          [[-0.5906,  1.6258],
           [ 0.6444, -0.0542]]])
  >>> scales = (torch.randn(2) + 1) * 0.05
  >>> scales
  tensor([0.0475, 0.0486])
  >>> zero_points = torch.zeros(2).to(torch.int32)
  >>> zero_points
  tensor([0, 0])
  >>> torch.fake_quantize_per_channel_affine(x, scales, zero_points, 1, 0, 255)
  tensor([[[0.0000, 0.0000],
           [0.3405, 0.0000]],

          [[0.0000, 1.6134],
          [0.6323, 0.0000]]])


torch.Tensor.subtract
Tensor.subtract(other, *, alpha=1) -> Tensor
See "torch.subtract()".


torch.nn.functional.instance_norm
torch.nn.functional.instance_norm(input, running_mean=None, running_var=None, weight=None, bias=None, use_input_stats=True, momentum=0.1, eps=1e-05)
Applies Instance Normalization for each channel in each data sample
   in a batch.
See "InstanceNorm1d", "InstanceNorm2d", "InstanceNorm3d" for
   details.
Return type:
      Tensor


torch.Tensor.random_
Tensor.random_(from=0, to=None, *, generator=None) -> Tensor
Fills "self" tensor with numbers sampled from the discrete uniform
   distribution over "[from, to - 1]". If not specified, the values
   are usually only bounded by "self" tensor's data type. However, for
   floating point types, if unspecified, range will be "[0,
   2^mantissa]" to ensure that every value is representable. For
   example, torch.tensor(1, dtype=torch.double).random_() will be
   uniform in "[0, 2^53]".


per_channel_dynamic_qconfig
torch.quantization.qconfig.per_channel_dynamic_qconfig
alias of QConfig(activation=functools.partial(,
   dtype=torch.quint8, quant_min=0, quant_max=255, is_dynamic=True){},
   weight=functools.partial(,
   dtype=torch.qint8, qscheme=torch.per_channel_symmetric){})


torch.fft.ihfftn
torch.fft.ihfftn(input, s=None, dim=None, norm=None, *, out=None) -> Tensor
Computes the N-dimensional inverse discrete Fourier transform of
   real "input".
"input" must be a real-valued signal, interpreted in the Fourier
   domain. The n-dimensional IFFT of a real signal is Hermitian-
   symmetric, "X[i, j, ...] = conj(X[-i, -j, ...])". "ihfftn()"
   represents this in the one-sided form where only the positive
   frequencies below the Nyquist frequency are included in the last
   signal dimension. To compute the full output, use "ifftn()".
Note:
 Supports torch.half 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 Hermitian 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: all dimensions, or the last "len(s)"
    dimensions if "s" is given.

  * **norm** (*str**, **optional*) --

    Normalization mode. For the backward transform ("ihfftn()"),
    these correspond to:

    * ""forward"" - no normalization

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

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

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


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

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

T = torch.rand(10, 10)
ihfftn = torch.fft.ihfftn(T)
ihfftn.size()
   torch.Size([10, 6])

Compared against the full output from "ifftn()", we have all
   elements up to the Nyquist frequency.

ifftn = torch.fft.ifftn(t)
torch.allclose(ifftn[..., :6], ihfftn)
   True

The discrete Fourier transform is separable, so "ihfftn()" here is
   equivalent to a combination of "ihfft()" and "ifft()":

two_iffts = torch.fft.ifft(torch.fft.ihfft(t, dim=1), dim=0)
torch.allclose(ihfftn, two_iffts)
   True


torch.isnan
torch.isnan(input) -> Tensor
Returns a new tensor with boolean elements representing if each
   element of "input" is NaN or not. Complex values are considered NaN
   when either their real and/or imaginary part is NaN.
Parameters:
      input (Tensor) -- the input tensor.
Returns:
      A boolean tensor that is True where "input" is NaN and False
      elsewhere
Example:
  >>> torch.isnan(torch.tensor([1, float('nan'), 2]))
  tensor([False, True, False])


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

where \mathrm{I}_n is the n-dimensional identity matrix.
Supports input of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if "A" is a batch of matrices
   then the output has the same batch dimensions.
Note:
 The eigenvalues of a real matrix may be complex, as the roots of
 a real polynomial may be complex.The eigenvalues of a matrix are
 always well-defined, even when the matrix is not diagonalizable.

Note:


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

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

Parameters:
      A (Tensor) -- tensor of shape (, n, n)* where *** is
      zero or more batch dimensions.
Keyword Arguments:
      out (Tensor, optional) -- output tensor. Ignored if
      None. Default: None.
Returns:
      A complex-valued tensor containing the eigenvalues even when "A"
      is real.
Examples:
  >>> A = torch.randn(2, 2, dtype=torch.complex128)
  >>> L = torch.linalg.eigvals(A)
  >>> L
  tensor([ 1.1226+0.5738j, -0.7537-0.1286j], dtype=torch.complex128)

  >>> torch.dist(L, torch.linalg.eig(A).eigenvalues)
  tensor(2.4576e-07)


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


torch.Tensor.clip_
Tensor.clip_(min=None, max=None) -> Tensor
Alias for "clamp_()".


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

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

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

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


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

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[ 0.6451, -0.4866,  0.2987, -1.3312],
          [-0.5744,  1.2980,  1.8397, -0.2713],
          [ 0.9128,  0.9214, -1.7268, -0.2995],
          [ 0.9023,  0.4853,  0.9075, -1.6165]])
  >>> torch.amin(a, 1)
  tensor([-1.3312, -0.5744, -1.7268, -1.6165])


torch.ones_like
torch.ones_like(input, *, dtype=None, layout=None, device=None, requires_grad=False, memory_format=torch.preserve_format) -> Tensor
Returns a tensor filled with the scalar value 1, with the same
   size as "input". "torch.ones_like(input)" is equivalent to
   "torch.ones(input.size(), dtype=input.dtype, layout=input.layout,
   device=input.device)".
Warning:
 As of 0.4, this function does not support an "out" keyword. As an
 alternative, the old "torch.ones_like(input, out=output)" is
 equivalent to "torch.ones(input.size(), out=output)".

Parameters:
      input (Tensor) -- the size of "input" will determine size
      of the output tensor.
Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned Tensor. Default: if "None", defaults to the dtype
        of "input".
  * **layout** ("torch.layout", optional) -- the desired layout of


returned tensor. Default: if "None", defaults to the layout of
        "input".
  * **device** ("torch.device", optional) -- the desired device of
    returned tensor. Default: if "None", defaults to the device of
    "input".

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

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

Example:
  >>> input = torch.empty(2, 3)
  >>> torch.ones_like(input)
  tensor([[ 1.,  1.,  1.],
          [ 1.,  1.,  1.]])


torch.sub
torch.sub(input, other, *, alpha=1, out=None) -> Tensor
Subtracts "other", scaled by "alpha", from "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
    subtract from "input".

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

Example:
  >>> a = torch.tensor((1, 2))
  >>> b = torch.tensor((0, 1))
  >>> torch.sub(a, b, alpha=2)
  tensor([1, 0])


QConfigMapping
class torch.ao.quantization.qconfig_mapping.QConfigMapping
Mapping from model ops to "torch.ao.quantization.QConfig" s.
The user can specify QConfigs using the following methods (in
   increasing match priority):
  "set_global" : sets the global (default) QConfig

  "set_object_type" : sets the QConfig for a given module type,
  function, or method name

  "set_module_name_regex" : sets the QConfig for modules matching
  the given regex string

  "set_module_name" : sets the QConfig for modules matching the
  given module name

  "set_module_name_object_type_order" : sets the QConfig for
  modules matching a combination of the given module name, object
  type, and the index at which the module appears

Example usage:
  qconfig_mapping = QConfigMapping()
      .set_global(global_qconfig)
      .set_object_type(torch.nn.Linear, qconfig1)
      .set_object_type(torch.nn.ReLU, qconfig1)


.set_module_name_regex("foo.bar.conv[0-9]+", qconfig1)
          .set_module_name_regex("foo.*", qconfig2)
          .set_module_name("module1", qconfig1)
          .set_module_name("module2", qconfig2)
          .set_module_name_object_type_order("foo.bar", torch.nn.functional.linear, 0, qconfig3)
classmethod from_dict(qconfig_dict)
  Create a "QConfigMapping" from a dictionary with the following
  keys (all optional):

     "" (for global QConfig)

     "object_type"

     "module_name_regex"

     "module_name"

     "module_name_object_type_order"

  The values of this dictionary are expected to be lists of
  tuples.

  Return type:
     *QConfigMapping*

set_global(global_qconfig)
  Set the global (default) QConfig.

  Return type:
     *QConfigMapping*

set_module_name(module_name, qconfig)
  Set the QConfig for modules matching the given module name. If


the QConfig for an existing module name was already set, the new
      QConfig will override the old one.
  Return type:
     *QConfigMapping*

set_module_name_object_type_order(module_name, object_type, index, qconfig)
  Set the QConfig for modules matching a combination of the given
  module name, object type, and the index at which the module
  appears.

  If the QConfig for an existing (module name, object type, index)
  was already set, the new QConfig will override the old one.

  Return type:
     *QConfigMapping*

set_module_name_regex(module_name_regex, qconfig)
  Set the QConfig for modules matching the given regex string.

  Regexes will be matched in the order in which they are
  registered through this method. Thus, the caller should register
  more specific patterns first, e.g.:

     qconfig_mapping = QConfigMapping()
         .set_module_name_regex("foo.*bar.*conv[0-9]+", qconfig1)


.set_module_name_regex("foo.bar.", qconfig2)
             .set_module_name_regex("foo.*", qconfig3)
  In this example, "foo.bar.conv0" would match qconfig1,
  "foo.bar.linear" would match qconfig2, and "foo.baz.relu" would
  match qconfig3.

  If the QConfig for an existing module name regex was already
  set, the new QConfig will override the old one while preserving
  the order in which the regexes were originally registered.

  Return type:
     *QConfigMapping*

set_object_type(object_type, qconfig)
  Set the QConfig for a given module type, function, or method
  name. If the QConfig for an existing object type was already
  set, the new QConfig will override the old one.

  Return type:
     *QConfigMapping*

to_dict()
  Convert this "QConfigMapping" to a dictionary with the following
  keys:

     "" (for global QConfig)

     "object_type"

     "module_name_regex"

     "module_name"


"module_name"
     "module_name_object_type_order"

  The values of this dictionary are lists of tuples.

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


torch.var
torch.var(input, dim=None, *, correction=1, keepdim=False, out=None) -> Tensor
Calculates the variance over the dimensions specified by "dim".
   "dim" can be a single dimension, list of dimensions, or "None" to
   reduce over all dimensions.
The variance (\sigma^2) is calculated as
  \sigma^2 = \frac{1}{N - \delta N}\sum_{i=0}^{N-1}(x_i-\bar{x})^2

where x is the sample set of elements, \bar{x} is the sample mean,
   N is the number of samples and \delta N is the "correction".
If "keepdim" is "True", the output tensor is of the same size as
   "input" except in the dimension(s) "dim" where it is of size 1.
   Otherwise, "dim" is squeezed (see "torch.squeeze()"), resulting in
   the output tensor having 1 (or "len(dim)") fewer dimension(s).
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int** or **tuple of ints**, **optional*) -- the
    dimension or dimensions to reduce. If "None", all dimensions
    are reduced.


are reduced.
Keyword Arguments:
      * correction (int) --
    difference between the sample size and sample degrees of
    freedom. Defaults to Bessel's correction, "correction=1".

    Changed in version 2.0: Previously this argument was called
    "unbiased" and was a boolean with "True" corresponding to
    "correction=1" and "False" being "correction=0".

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

  * **out** (*Tensor**, **optional*) -- the output tensor.

-[ Example ]-

a = torch.tensor(
   ...     [[ 0.2035,  1.2959,  1.8101, -0.4644],
   ...      [ 1.5027, -0.3270,  0.5905,  0.6538],
   ...      [-1.5745,  1.3330, -0.5596, -0.6548],
   ...      [ 0.1264, -0.5080,  1.6420,  0.1992]])
torch.var(a, dim=1, keepdim=True)
   tensor([[1.0631],
           [0.5590],
           [1.4893],
           [0.8258]])


torch.multinomial
torch.multinomial(input, num_samples, replacement=False, *, generator=None, out=None) -> LongTensor
Returns a tensor where each row contains "num_samples" indices
   sampled from the multinomial probability distribution located in
   the corresponding row of tensor "input".
Note:
 The rows of "input" do not need to sum to one (in which case we
 use the values as weights), but must be non-negative, finite and
 have a non-zero sum.

Indices are ordered from left to right according to when each was
   sampled (first samples are placed in first column).
If "input" is a vector, "out" is a vector of size "num_samples".
If "input" is a matrix with m rows, "out" is an matrix of shape
   (m \times \text{num_samples}).
If replacement is "True", samples are drawn with replacement.
If not, they are drawn without replacement, which means that when a
   sample index is drawn for a row, it cannot be drawn again for that
   row.
Note:


row.
Note:
 When drawn without replacement, "num_samples" must be lower than
 number of non-zero elements in "input" (or the min number of non-
 zero elements in each row of "input" if it is a matrix).

Parameters:
      * input (Tensor) -- the input tensor containing
        probabilities
  * **num_samples** (*int*) -- number of samples to draw

  * **replacement** (*bool**, **optional*) -- whether to draw with
    replacement or not

Keyword Arguments:
      * generator ("torch.Generator", optional) -- a pseudorandom
        number generator for sampling
  * **out** (*Tensor**, **optional*) -- the output tensor.

Example:
  >>> weights = torch.tensor([0, 10, 3, 0], dtype=torch.float) # create a tensor of weights
  >>> torch.multinomial(weights, 2)
  tensor([1, 2])
  >>> torch.multinomial(weights, 4) # ERROR!
  RuntimeError: invalid argument 2: invalid multinomial distribution (with replacement=False,


not enough non-negative category to sample) at ../aten/src/TH/generic/THTensorRandom.cpp:320
      >>> torch.multinomial(weights, 4, replacement=True)
      tensor([ 2,  1,  1,  1])


torch.histogramdd
torch.histogramdd(input, bins, *, range=None, weight=None, density=False, out=None) -> (Tensor, Tensor[])
Computes a multi-dimensional histogram of the values in a tensor.
Interprets the elements of an input tensor whose innermost
   dimension has size N as a collection of N-dimensional points. Maps
   each of the points into a set of N-dimensional bins and returns the
   number of points (or total weight) in each bin.
"input" must be a tensor with at least 2 dimensions. If input has
   shape (M, N), each of its M rows defines a point in N-dimensional
   space. If input has three or more dimensions, all but the last
   dimension are flattened.
Each dimension is independently associated with its own strictly
   increasing sequence of bin edges. Bin edges may be specified
   explicitly by passing a sequence of 1D tensors. Alternatively, bin
   edges may be constructed automatically by passing a sequence of


integers specifying the number of equal-width bins in each
   dimension.
For each N-dimensional point in input:
      * Each of its coordinates is binned independently among the bin
        edges
           corresponding to its dimension
  * Binning results are combined to identify the N-dimensional bin
    (if any)
       into which the point falls

  * If the point falls into a bin, the bin's count (or total
    weight) is incremented

  * Points which do not fall into any bin do not contribute to the
    output

"bins" can be a sequence of N 1D tensors, a sequence of N ints, or
   a single int.
If "bins" is a sequence of N 1D tensors, it explicitly specifies
   the N sequences of bin edges. Each 1D tensor should contain a
   strictly increasing sequence with at least one element. A sequence
   of K bin edges defines K-1 bins, explicitly specifying the left and
   right edges of all bins. Every bin is exclusive of its left edge.


Only the rightmost bin is inclusive of its right edge.
If "bins" is a sequence of N ints, it specifies the number of
   equal-width bins in each dimension. By default, the leftmost and
   rightmost bin edges in each dimension are determined by the minimum
   and maximum elements of the input tensor in the corresponding
   dimension. The "range" argument can be provided to manually specify
   the leftmost and rightmost bin edges in each dimension.
If "bins" is an int, it specifies the number of equal-width bins
   for all dimensions.
Note:
 See also "torch.histogram()", which specifically computes 1D
 histograms. While "torch.histogramdd()" infers the dimensionality
 of its bins and binned values from the shape of "input",
 "torch.histogram()" accepts and flattens "input" of any shape.

Parameters:
      * input (Tensor) -- the input tensor.
  * **bins** -- Tensor[], int[], or int. If Tensor[], defines the


sequences of bin edges. If int[], defines the number of equal-
        width bins in each dimension. If int, defines the number of
        equal-width bins for all dimensions.
Keyword Arguments:
      * range (sequence of python:float) -- Defines the leftmost
        and rightmost bin edges in each dimension.
  * **weight** (*Tensor*) -- By default, each value in the input
    has weight 1. If a weight tensor is passed, each N-dimensional
    coordinate in input contributes its associated weight towards
    its bin's result. The weight tensor should have the same shape
    as the "input" tensor excluding its innermost dimension N.

  * **density** (*bool*) -- If False (default), the result will
    contain the count (or total weight) in each bin. If True, each
    count (weight) is divided by the total count (total weight),
    then divided by the volume of its associated bin.

Returns:
      N-dimensional Tensor containing the values of the histogram.


bin_edges(Tensor[]): sequence of N 1D Tensors containing the bin
      edges.
Return type:
      hist (Tensor)
Example::
      >>> torch.histogramdd(torch.tensor([[0., 1.], [1., 0.], [2., 0.], [2., 2.]]), bins=[3, 3],
      ...                   weight=torch.tensor([1., 2., 4., 8.]))
          torch.return_types.histogramdd(
              hist=tensor([[0., 1., 0.],
                           [2., 0., 0.],
                           [4., 0., 8.]]),
              bin_edges=(tensor([0.0000, 0.6667, 1.3333, 2.0000]),
                         tensor([0.0000, 0.6667, 1.3333, 2.0000])))
  >>> torch.histogramdd(torch.tensor([[0., 0.], [1., 1.], [2., 2.]]), bins=[2, 2],
  ...                   range=[0., 1., 0., 1.], density=True)
      torch.return_types.histogramdd(
         hist=tensor([[2., 0.],
                      [0., 2.]]),
         bin_edges=(tensor([0.0000, 0.5000, 1.0000]),
                    tensor([0.0000, 0.5000, 1.0000])))


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


torch.row_stack
torch.row_stack(tensors, *, out=None) -> Tensor
Alias of "torch.vstack()".


torch.Tensor.is_conj
Tensor.is_conj() -> bool
Returns True if the conjugate bit of "self" is set to true.


torch.empty
torch.empty(size, , out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False, memory_format=torch.contiguous_format) -> Tensor
Returns a tensor filled with uninitialized data. The shape of the
   tensor is defined by the variable argument "size".
Parameters:
      size (int...) -- a sequence of integers defining the
      shape of the output tensor. Can be a variable number of
      arguments or a collection like a list or tuple.
Keyword Arguments:
      * out (Tensor, optional) -- the output tensor.
  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor. Default: if "None", uses a global default
    (see "torch.set_default_tensor_type()").

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

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


returned tensor. Default: if "None", uses the current device
        for the default tensor type (see
        "torch.set_default_tensor_type()"). "device" will be the CPU
        for CPU tensor types and the current CUDA device for CUDA
        tensor types.
  * **requires_grad** (*bool**, **optional*) -- If autograd should
    record operations on the returned tensor. Default: "False".

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

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

Example:
  >>> torch.empty((2,3), dtype=torch.int64)
  tensor([[ 9.4064e+13,  2.8000e+01,  9.3493e+13],
          [ 7.5751e+18,  7.1428e+18,  7.5955e+18]])


torch.nn.functional.elu
torch.nn.functional.elu(input, alpha=1.0, inplace=False)
Applies the Exponential Linear Unit (ELU) function element-wise.
See "ELU" for more details.
Return type:
      Tensor


ConvTranspose2d
class torch.ao.nn.quantized.ConvTranspose2d(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 2D transposed convolution operator over an input image
   composed of several input planes. For details on input arguments,
   parameters, and implementation see "ConvTranspose2d".
For special notes, please, see "Conv2d"
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 "ConvTranspose2d" for other attributes.
Examples:
  >>> # QNNPACK or FBGEMM as backend
  >>> torch.backends.quantized.engine = 'qnnpack'
  >>> # With square kernels and equal stride
  >>> import torch.nn.quantized as nnq


import torch.nn.quantized as nnq
      >>> m = nnq.ConvTranspose2d(16, 33, 3, stride=2)
      >>> # non-square kernels and unequal stride and with padding
      >>> m = nnq.ConvTranspose2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
      >>> input = torch.randn(20, 16, 50, 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)
      >>> q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0, dtype=torch.quint8)
      >>> downsample = nnq.Conv2d(16, 16, 3, stride=2, padding=1)
      >>> upsample = nnq.ConvTranspose2d(16, 16, 3, stride=2, padding=1)
      >>> h = downsample(q_input)
      >>> h.size()
      torch.Size([1, 16, 6, 6])
      >>> output = upsample(h, output_size=input.size())
      >>> output.size()
      torch.Size([1, 16, 12, 12])


torch.vdot
torch.vdot(input, other, *, out=None) -> Tensor
Computes the dot product of two 1D vectors along a dimension.
In symbols, this function computes
  \sum_{i=1}^n \overline{x_i}y_i.

where \overline{x_i} denotes the conjugate for complex vectors, and
   it is the identity for real vectors.
Note:
 Unlike NumPy's vdot, torch.vdot intentionally only supports
 computing the dot product of two 1D tensors with the same number
 of elements.

See also:
 "torch.linalg.vecdot()" computes the dot product of two batches
 of vectors along a dimension.

Parameters:
      * input (Tensor) -- first tensor in the dot product, must
        be 1D. Its conjugate is used if it's complex.
  * **other** (*Tensor*) -- second tensor in the dot product, must
    be 1D.

Keyword args:
Note:
 out (Tensor, optional): the output tensor.

Example:
  >>> torch.vdot(torch.tensor([2, 3]), torch.tensor([2, 1]))
  tensor(7)


tensor(7)
      >>> a = torch.tensor((1 +2j, 3 - 1j))
      >>> b = torch.tensor((2 +1j, 4 - 0j))
      >>> torch.vdot(a, b)
      tensor([16.+1.j])
      >>> torch.vdot(b, a)
      tensor([16.-1.j])


torch.nn.utils.vector_to_parameters
torch.nn.utils.vector_to_parameters(vec, parameters)
Convert one vector to the parameters
Parameters:
      * vec (Tensor) -- a single vector represents the
        parameters of a model.
  * **parameters** (*Iterable**[**Tensor**]*) -- an iterator of
    Tensors that are the parameters of a model.


torch.svd
torch.svd(input, some=True, compute_uv=True, *, out=None)
Computes the singular value decomposition of either a matrix or
   batch of matrices "input". The singular value decomposition is
   represented as a namedtuple (U, S, V), such that "input" = U
   \text{diag}(S) V^{\text{H}}. where V^{\text{H}} is the transpose of
   V for real inputs, and the conjugate transpose of V for complex
   inputs. If "input" is a batch of matrices, then U, S, and V
   are also batched with the same batch dimensions as "input".
If "some" is True (default), the method returns the reduced
   singular value decomposition. In this case, if the last two
   dimensions of "input" are m and n, then the returned U and
   V matrices will contain only min(n, m) orthonormal columns.
If "compute_uv" is False, the returned U and V will be zero-
   filled matrices of shape (m, m) and (n, n) respectively, and


the same device as "input". The argument "some" has no effect when
   "compute_uv" is False.
Supports "input" of float, double, cfloat and cdouble data types.
   The dtypes of U and V are the same as "input"'s. S will
   always be real-valued, even if "input" is complex.
Warning:
 "torch.svd()" is deprecated in favor of "torch.linalg.svd()" and
 will be removed in a future PyTorch release."U, S, V =
 torch.svd(A, some=some, compute_uv=True)" (default) should be
 replaced with

    U, S, Vh = torch.linalg.svd(A, full_matrices=not some)
    V = Vh.mH

 "_, S, _ = torch.svd(A, some=some, compute_uv=False)" should be
 replaced with

    S = torch.linalg.svdvals(A)

Note:
 Differences with "torch.linalg.svd()":

 * "some" is the opposite of "torch.linalg.svd()"'s
   "full_matrices". Note that default value for both is *True*, so
   the default behavior is effectively the opposite.


"torch.svd()" returns V, whereas "torch.linalg.svd()" returns
       Vh, that is, V^{\text{H}}.

If "compute_uv" is False, "torch.svd()" returns zero-filled
   tensors for U and Vh, whereas "torch.linalg.svd()" returns
   empty tensors.

Note:
 The singular values are returned in descending order. If "input"
 is a batch of matrices, then the singular values of each matrix
 in the batch are returned in descending order.

Note:
 The *S* tensor can only be used to compute gradients if
 "compute_uv" is *True*.

Note:
 When "some" is *False*, the gradients on *U[..., :, min(m, n):]*
 and *V[..., :, min(m, n):]* will be ignored in the backward pass,
 as those vectors can be arbitrary bases of the corresponding
 subspaces.

Note:
 The implementation of "torch.linalg.svd()" on CPU uses LAPACK's
 routine *?gesdd* (a divide-and-conquer algorithm) instead of
 *?gesvd* for speed. Analogously, on GPU, it uses cuSOLVER's


routines gesvdj and gesvdjBatched on CUDA 10.1.243 and later,
     and MAGMA's routine gesdd on earlier versions of CUDA.
Note:
 The returned *U* will not be contiguous. The matrix (or batch of
 matrices) will be represented as a column-major matrix (i.e.
 Fortran-contiguous).

Warning:
 The gradients with respect to *U* and *V* will only be finite
 when the input does not have zero nor repeated singular values.

Warning:
 If the distance between any two singular values is close to zero,
 the gradients with respect to *U* and *V* will be numerically
 unstable, as they depends on \frac{1}{\min_{i \neq j} \sigma_i^2
 - \sigma_j^2}. The same happens when the matrix has small
 singular values, as these gradients also depend on *Sâ»Â¹*.

Warning:
 For complex-valued "input" the singular value decomposition is
 not unique, as *U* and *V* may be multiplied by an arbitrary
 phase factor e^{i \phi} on every column. The same happens when


"input" has repeated singular values, where one may multiply the
     columns of the spanning subspace in U and V by a rotation
     matrix and the resulting vectors will span the same subspace.
     Different platforms, like NumPy, or inputs on different device
     types, may produce different U and V tensors.
Parameters:
      * input (Tensor) -- the input tensor of size (, m, n)
        where *** is zero or more batch dimensions consisting of (m,
        n)* matrices.
  * **some** (*bool**, **optional*) -- controls whether to compute
    the reduced or full decomposition, and consequently, the shape
    of returned *U* and *V*. Default: *True*.

  * **compute_uv** (*bool**, **optional*) -- controls whether to
    compute *U* and *V*. Default: *True*.

Keyword Arguments:
      out (tuple, optional) -- the output tuple of tensors
Example:
  >>> a = torch.randn(5, 3)
  >>> a
  tensor([[ 0.2364, -0.7752,  0.6372],


tensor([[ 0.2364, -0.7752,  0.6372],
              [ 1.7201,  0.7394, -0.0504],
              [-0.3371, -1.0584,  0.5296],
              [ 0.3550, -0.4022,  1.5569],
              [ 0.2445, -0.0158,  1.1414]])
      >>> u, s, v = torch.svd(a)
      >>> u
      tensor([[ 0.4027,  0.0287,  0.5434],
              [-0.1946,  0.8833,  0.3679],
              [ 0.4296, -0.2890,  0.5261],
              [ 0.6604,  0.2717, -0.2618],
              [ 0.4234,  0.2481, -0.4733]])
      >>> s
      tensor([2.3289, 2.0315, 0.7806])
      >>> v
      tensor([[-0.0199,  0.8766,  0.4809],
              [-0.5080,  0.4054, -0.7600],
              [ 0.8611,  0.2594, -0.4373]])
      >>> torch.dist(a, torch.mm(torch.mm(u, torch.diag(s)), v.t()))
      tensor(8.6531e-07)
      >>> a_big = torch.randn(7, 5, 3)
      >>> u, s, v = torch.svd(a_big)
      >>> torch.dist(a_big, torch.matmul(torch.matmul(u, torch.diag_embed(s)), v.mT))
      tensor(2.6503e-06)


RNNBase
class torch.nn.RNNBase(mode, input_size, hidden_size, num_layers=1, bias=True, batch_first=False, dropout=0.0, bidirectional=False, proj_size=0, device=None, dtype=None)
flatten_parameters()
  Resets parameter data pointer so that they can use faster code
  paths.

  Right now, this works only if the module is on the GPU and cuDNN
  is enabled. Otherwise, it's a no-op.