shrinath-suresh/blogs-docs-splitted huggingface dataset:
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"
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,
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.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]])
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)
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.
torch.tril_indices
torch.tril_indices(row, col, offset=0, *, dtype=torch.long, device='cpu', layout=torch.strided) -> Tensor
Returns the indices of the lower 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 lower triangular part of the matrix is defined as the elements
   on and below the diagonal.
The argument "offset" controls which diagonal to consider. If
   "offset" = 0, all elements on and below the main diagonal are
   retained. A positive value includes just as many diagonals above
   the main diagonal, and similarly a negative value excludes 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.tril_indices(3, 3)
a = torch.tril_indices(3, 3)
      >>> a
      tensor([[0, 1, 1, 2, 2, 2],
              [0, 0, 1, 0, 1, 2]])



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

  >>> a = torch.tril_indices(4, 3, 1)
  >>> a
  tensor([[0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3],
          [0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2]])
torch.Tensor.copy_
Tensor.copy_(src, non_blocking=False) -> Tensor
Copies the elements from "src" into "self" tensor and returns
   "self".
The "src" tensor must be broadcastable with the "self" tensor. It
   may be of a different data type or reside on a different device.
Parameters:
      * src (Tensor) -- the source tensor to copy from
  * **non_blocking** (*bool*) -- if "True" and this copy is
    between CPU and GPU, the copy may occur asynchronously with
    respect to the host. For other cases, this argument has no
    effect.
torch.nn.functional.fractional_max_pool3d
torch.nn.functional.fractional_max_pool3d(args, *kwargs)
Applies 3D fractional max pooling over an input signal composed of
   several input planes.
Fractional MaxPooling is described in detail in the paper
   Fractional MaxPooling by Ben Graham
The max-pooling operation is applied in kT \times kH \times kW
   regions by a stochastic step size determined by the target output
   size. The number of output features is equal to the number of input
   planes.
Parameters:
      * kernel_size -- the size of the window to take a max over.
        Can be a single number k (for a square kernel of k \times k
        \times k) or a tuple (kT, kH, kW)
  * **output_size** -- the target output size of the form oT
    \times oH \times oW. Can be a tuple *(oT, oH, oW)* or a single
    number oH for a cubic output oH \times oH \times oH

  * **output_ratio** -- If one wants to have an output size as a