shrinath-suresh/blogs-docs-splitted huggingface dataset:
therefore, the embedding vector at "padding_idx" is not
        updated during training, i.e. it remains as a fixed "pad".
  * **max_norm** (*float**, **optional*) -- If given, each
    embedding vector with norm larger than "max_norm" is
    renormalized to have norm "max_norm". Note: this will modify
    "weight" in-place.

  * **norm_type** (*float**, **optional*) -- The p of the p-norm
    to compute for the "max_norm" option. Default "2".

  * **scale_grad_by_freq** (*bool**, **optional*) -- If given,
    this will scale gradients by the inverse of frequency of the
    words in the mini-batch. Default "False".

  * **sparse** (*bool**, **optional*) -- If "True", gradient
    w.r.t. "weight" will be a sparse tensor. See Notes under
    "torch.nn.Embedding" for more details regarding sparse
    gradients.

Return type:
      Tensor
Shape:
      * Input: LongTensor of arbitrary shape containing the indices to
        extract
extract
  * Weight: Embedding matrix of floating point type with shape
    *(V, embedding_dim)*, where V = maximum index + 1 and
    embedding_dim = the embedding size

  * Output: *(*, embedding_dim)*, where *** is the input shape

Examples:
  >>> # a batch of 2 samples of 4 indices each
  >>> input = torch.tensor([[1, 2, 4, 5], [4, 3, 2, 9]])
  >>> # an embedding matrix containing 10 tensors of size 3
  >>> embedding_matrix = torch.rand(10, 3)
  >>> F.embedding(input, embedding_matrix)
  tensor([[[ 0.8490,  0.9625,  0.6753],
           [ 0.9666,  0.7761,  0.6108],
           [ 0.6246,  0.9751,  0.3618],
           [ 0.4161,  0.2419,  0.7383]],

          [[ 0.6246,  0.9751,  0.3618],
           [ 0.0237,  0.7794,  0.0528],
           [ 0.9666,  0.7761,  0.6108],
           [ 0.3385,  0.8612,  0.1867]]])

  >>> # example with padding_idx
  >>> weights = torch.rand(10, 3)
  >>> weights[0, :].zero_()
weights[0, :].zero_()
      >>> embedding_matrix = weights
      >>> input = torch.tensor([[0, 2, 0, 5]])
      >>> F.embedding(input, embedding_matrix, padding_idx=0)
      tensor([[[ 0.0000,  0.0000,  0.0000],
               [ 0.5609,  0.5384,  0.8720],
               [ 0.0000,  0.0000,  0.0000],
               [ 0.6262,  0.2438,  0.7471]]])
torch.fft.hfft
torch.fft.hfft(input, n=None, dim=- 1, norm=None, *, out=None) -> Tensor
Computes the one dimensional discrete Fourier transform of a
   Hermitian symmetric "input" signal.
Note:
 "hfft()"/"ihfft()" are analogous to "rfft()"/"irfft()". The real
 FFT expects a real signal in the time-domain and gives a
 Hermitian symmetry in the frequency-domain. The Hermitian FFT is
 the opposite; Hermitian symmetric in the time-domain and real-
 valued in the frequency-domain. For this reason, special care
 needs to be taken with the length argument "n", in the same way
 as with "irfft()".

Note:
 Because the signal is Hermitian in the time-domain, the result
 will be real in the frequency domain. Note that some input
 frequencies must be real-valued to satisfy the Hermitian
 property. In these cases the imaginary component will be ignored.
 For example, any imaginary component in "input[0]" would result
in one or more complex frequency terms which cannot be
     represented in a real output and so will always be ignored.
Note:
 The correct interpretation of the Hermitian input depends on the
 length of the original data, as given by "n". This is because
 each input shape could correspond to either an odd or even length
 signal. By default, the signal is assumed to be even length and
 odd signals will not round-trip properly. So, it is recommended
 to always pass the signal length "n".

Note:
 Supports torch.half and torch.chalf on CUDA with GPU Architecture
 SM53 or greater. However it only supports powers of 2 signal
 length in every transformed dimension. With default arguments,
 size of the transformed dimension should be (2^n + 1) as argument
 *n* defaults to even output size = 2 * (transformed_dim_size - 1)

Parameters:
      * input (Tensor) -- the input tensor representing a half-
        Hermitian signal
Hermitian signal
  * **n** (*int**, **optional*) -- Output signal length. This
    determines the length of the real output. If given, the input
    will either be zero-padded or trimmed to this length before
    computing the Hermitian FFT. Defaults to even output:
    "n=2*(input.size(dim) - 1)".

  * **dim** (*int**, **optional*) -- The dimension along which to
    take the one dimensional Hermitian FFT.

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

    Normalization mode. For the forward transform ("hfft()"),
    these correspond to:

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

    * ""backward"" - no normalization

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

    Calling the backward transform ("ihfft()") with the same
    normalization mode will apply an overall normalization of
    "1/n" between the two transforms. This is required to make
    "ihfft()" the exact inverse.
"ihfft()" the exact inverse.
    Default is ""backward"" (no normalization).

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
-[ Example ]-
Taking a real-valued frequency signal and bringing it into the time
   domain gives Hermitian symmetric output:



t = torch.linspace(0, 1, 5)
t
   tensor([0.0000, 0.2500, 0.5000, 0.7500, 1.0000])
T = torch.fft.ifft(t)
T
   tensor([ 0.5000-0.0000j, -0.1250-0.1720j, -0.1250-0.0406j, -0.1250+0.0406j,
           -0.1250+0.1720j])



Note that "T[1] == T[-1].conj()" and "T[2] == T[-2].conj()" is
   redundant. We can thus compute the forward transform without
   considering negative frequencies:



torch.fft.hfft(T[:3], n=5)
   tensor([0.0000, 0.2500, 0.5000, 0.7500, 1.0000])



Like with "irfft()", the output length must be given in order to
   recover an even length output:



torch.fft.hfft(T[:3])
   tensor([0.1250, 0.2809, 0.6250, 0.9691])
UpsamplingNearest2d
class torch.nn.UpsamplingNearest2d(size=None, scale_factor=None)
Applies a 2D nearest neighbor upsampling to an input signal
   composed of several input channels.
To specify the scale, it takes either the "size" or the
   "scale_factor" as it's constructor argument.
When "size" is given, it is the output size of the image (h, w).
Parameters:
      * size (int or Tuple[int, int],
        optional) -- output spatial sizes
  * **scale_factor** (*float** or **Tuple**[**float**,
    **float**]**, **optional*) -- multiplier for spatial size.

Warning:
 This class is deprecated in favor of "interpolate()".

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

  H_{out} = \left\lfloor H_{in} \times \text{scale\_factor}
  \right\rfloor

  W_{out} = \left\lfloor W_{in} \times \text{scale\_factor}
  \right\rfloor

Examples:
\right\rfloor
Examples:
  >>> input = torch.arange(1, 5, dtype=torch.float32).view(1, 1, 2, 2)
  >>> input
  tensor([[[[1., 2.],
            [3., 4.]]]])

  >>> m = nn.UpsamplingNearest2d(scale_factor=2)
  >>> m(input)
  tensor([[[[1., 1., 2., 2.],
            [1., 1., 2., 2.],
            [3., 3., 4., 4.],
            [3., 3., 4., 4.]]]])
quantize_dynamic
class torch.quantization.quantize_dynamic(model, qconfig_spec=None, dtype=torch.qint8, mapping=None, inplace=False)
Converts a float model to dynamic (i.e. weights-only) quantized
   model.
Replaces specified modules with dynamic weight-only quantized
   versions and output the quantized model.
For simplest usage provide dtype argument that can be float16 or
   qint8. Weight-only quantization by default is performed for layers
   with large weights size - i.e. Linear and RNN variants.
Fine grained control is possible with qconfig and mapping that
   act similarly to quantize(). If qconfig is provided, the
   dtype argument is ignored.
Parameters:
      * model -- input model
  * **qconfig_spec** --

    Either:

    * A dictionary that maps from name or type of submodule to
      quantization configuration, qconfig applies to all
      submodules of a given module unless qconfig for the
submodules are specified (when the submodule already has
          qconfig attribute). Entries in the dictionary need to be
          QConfig instances.
    * A set of types and/or submodule names to apply dynamic
      quantization to, in which case the *dtype* argument is used
      to specify the bit-width

  * **inplace** -- carry out model transformations in-place, the
    original module is mutated

  * **mapping** -- maps type of a submodule to a type of
    corresponding dynamically quantized version with which the
    submodule needs to be replaced
ConvTranspose1d
class torch.nn.ConvTranspose1d(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 1D transposed convolution operator over an input image
   composed of several input planes.
This module can be seen as the gradient of Conv1d with respect to
   its input. It is also known as a fractionally-strided convolution
   or a deconvolution (although it is not an actual deconvolution
   operation as it does not compute a true inverse of convolution).
   For more information, see the visualizations here and the
   Deconvolutional Networks paper.
This module supports TensorFloat32.
On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.


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


"padding" controls the amount of implicit zero padding on both
with its own set of filters (of size
          \frac{\text{out_channels}}{\text{in_channels}}).
Note:
 The "padding" argument effectively adds "dilation * (kernel_size
 - 1) - padding" amount of zero padding to both sizes of the
 input. This is set so that when a "Conv1d" and a
 "ConvTranspose1d" are initialized with same parameters, they are
 inverses of each other in regard to the input and output shapes.
 However, when "stride > 1", "Conv1d" maps multiple input shapes
 to the same output shape. "output_padding" is provided to resolve
 this ambiguity by effectively increasing the calculated output
 shape on one side. Note that "output_padding" is only used to
 find output shape, but does not actually add zero-padding to
 output.

Note:
 In some circumstances when using the CUDA backend with CuDNN,
 this operator may select a nondeterministic algorithm to increase
 performance. If this is undesirable, you can try to make the
operation deterministic (potentially at a performance cost) by
     setting "torch.backends.cudnn.deterministic = True". Please see
     the notes on Reproducibility for background.
Parameters:
      * in_channels (int) -- Number of channels in the input
        image
  * **out_channels** (*int*) -- Number of channels produced by the
    convolution

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

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

  * **padding** (*int** or **tuple**, **optional*) -- "dilation *
    (kernel_size - 1) - padding" zero-padding will be added to
    both sides of the input. Default: 0

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

  * **groups** (*int**, **optional*) -- Number of blocked
connections from input channels to output channels. Default: 1
  * **bias** (*bool**, **optional*) -- If "True", adds a learnable
    bias to the output. Default: "True"

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

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

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

Variables:
      * weight (Tensor) -- the learnable weights of the module
        of shape (\text{in_channels},
        \frac{\text{out_channels}}{\text{groups}},
        \text{kernel_size}). The values of these weights are sampled
        from \mathcal{U}(-\sqrt{k}, \sqrt{k}) where k =
        \frac{groups}{C_\text{out} * \text{kernel_size}}
torch.hypot
torch.hypot(input, other, *, out=None) -> Tensor
Given the legs of a right triangle, return its hypotenuse.
  \text{out}_{i} = \sqrt{\text{input}_{i}^{2} +
  \text{other}_{i}^{2}}

The shapes of "input" and "other" must be broadcastable.
Parameters:
      * input (Tensor) -- the first input tensor
  * **other** (*Tensor*) -- the second input tensor

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.hypot(torch.tensor([4.0]), torch.tensor([3.0, 4.0, 5.0]))
  tensor([5.0000, 5.6569, 6.4031])
torch.Tensor.to_sparse_bsc
Tensor.to_sparse_bsc(blocksize, dense_dim) -> Tensor
Convert a tensor to a block sparse column (BSC) storage format of
   given blocksize.  If the "self" is strided, then the number of
   dense dimensions could be specified, and a hybrid BSC tensor will
   be created, with dense_dim dense dimensions and self.dim() - 2 -
   dense_dim batch dimension.
Parameters:
      * blocksize (list, tuple, "torch.Size", optional) -- Block
        size of the resulting BSC tensor. A block size must be a tuple
        of length two such that its items evenly divide the two sparse
        dimensions.
  * **dense_dim** (*int**, **optional*) -- Number of dense
    dimensions of the resulting BSC tensor.  This argument should
    be used only if "self" is a strided tensor, and must be a
    value between 0 and dimension of "self" tensor minus two.

Example:
  >>> dense = torch.randn(10, 10)
  >>> sparse = dense.to_sparse_csr()
sparse = dense.to_sparse_csr()
      >>> sparse_bsc = sparse.to_sparse_bsc((5, 5))
      >>> sparse_bsc.row_indices()
      tensor([0, 1, 0, 1])



  >>> dense = torch.zeros(4, 3, 1)
  >>> dense[0:2, 0] = dense[0:2, 2] = dense[2:4, 1] = 1
  >>> dense.to_sparse_bsc((2, 1), 1)
  tensor(ccol_indices=tensor([0, 1, 2, 3]),
         row_indices=tensor([0, 1, 0]),
         values=tensor([[[[1.]],

                         [[1.]]],


                        [[[1.]],

                         [[1.]]],


                        [[[1.]],

                         [[1.]]]]), size=(4, 3, 1), nnz=3,
         layout=torch.sparse_bsc)
torch.bartlett_window
torch.bartlett_window(window_length, periodic=True, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Bartlett window function.
  w[n] = 1 - \left| \frac{2n}{N-1} - 1 \right| = \begin{cases}
  \frac{2n}{N - 1} & \text{if } 0 \leq n \leq \frac{N - 1}{2} \\
  2 - \frac{2n}{N - 1} & \text{if } \frac{N - 1}{2} < n < N \\
  \end{cases},

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.bartlett_window(L, periodic=True)" equal to
   "torch.bartlett_window(L + 1, periodic=False)[:-1])".
Note:
Note:
 If "window_length" =1, the returned window contains a single
 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
BasePruningMethod
class torch.nn.utils.prune.BasePruningMethod
Abstract base class for creation of new pruning techniques.
Provides a skeleton for customization requiring the overriding of
   methods such as "compute_mask()" and "apply()".
classmethod apply(module, name, args, importance_scores=None, *kwargs)
  Adds the forward pre-hook that enables pruning on the fly and
  the reparametrization of a tensor in terms of the original
  tensor and the pruning mask.

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

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

     * **args** -- arguments passed on to a subclass of
       "BasePruningMethod"

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

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

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

  Returns:
     pruned version of the input tensor

  Return type:
     pruned_tensor (torch.Tensor)

abstract compute_mask(t, default_mask)
  Computes and returns a mask for the input tensor "t". Starting
  from a base "default_mask" (which should be a mask of ones if
  the tensor has not been pruned yet), generate a random mask to
apply on top of the "default_mask" according to the specific
      pruning method recipe.
  Parameters:
     * **t** (*torch.Tensor*) -- tensor representing the
       importance scores of the

     * **prune.** (*parameter to*) --

     * **default_mask** (*torch.Tensor*) -- Base mask from
       previous pruning

     * **iterations** --

     * **is** (*that need to be respected after the new mask*) --

     * **t.** (*applied. Same dims as*) --

  Returns:
     mask to apply to "t", of same dims as "t"

  Return type:
     mask (torch.Tensor)

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

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

     * **importance_scores** (*torch.Tensor*) -- tensor of
importance scores (of same shape as "t") used to compute
           mask for pruning "t". The values in this tensor indicate
           the importance of the corresponding elements in the "t"
           that is being pruned. If unspecified or None, the tensor
           "t" will be used in its place.
     * **default_mask** (*torch.Tensor**, **optional*) -- mask
       from previous pruning iteration, if any. To be considered
       when determining what portion of the tensor that pruning
       should act on. If None, default to a mask of ones.

  Returns:
     pruned version of tensor "t".

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

  Note:

    Pruning itself is NOT undone or reversed!
torch.logspace
torch.logspace(start, end, steps, base=10.0, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Creates a one-dimensional tensor of size "steps" whose values are
   evenly spaced from {{\text{{base}}}}^{{\text{{start}}}} to
   {{\text{{base}}}}^{{\text{{end}}}}, inclusive, on a logarithmic
   scale with base "base". That is, the values are:
  (\text{base}^{\text{start}}, \text{base}^{(\text{start} +
  \frac{\text{end} - \text{start}}{ \text{steps} - 1})}, \ldots,
  \text{base}^{(\text{start} + (\text{steps} - 2) *
  \frac{\text{end} - \text{start}}{ \text{steps} - 1})},
  \text{base}^{\text{end}})

From PyTorch 1.11 logspace requires the steps argument. Use
   steps=100 to restore the previous behavior.
Parameters:
      * start (float) -- the starting value for the set of
        points
  * **end** (*float*) -- the ending value for the set of points
steps (int) -- size of the constructed tensor

base (float, optional) -- base of the logarithm
    function. Default: "10.0".



Keyword Arguments:
      * out (Tensor, optional) -- the output tensor.
  * **dtype** (*torch.dtype**, **optional*) -- the data type to
    perform the computation in. Default: if None, uses the global
    default dtype (see torch.get_default_dtype()) when both
    "start" and "end" are real, and corresponding complex dtype
    when either is complex.

  * **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.
tensor types.
  * **requires_grad** (*bool**, **optional*) -- If autograd should
    record operations on the returned tensor. Default: "False".

Example:
  >>> torch.logspace(start=-10, end=10, steps=5)
  tensor([ 1.0000e-10,  1.0000e-05,  1.0000e+00,  1.0000e+05,  1.0000e+10])
  >>> torch.logspace(start=0.1, end=1.0, steps=5)
  tensor([  1.2589,   2.1135,   3.5481,   5.9566,  10.0000])
  >>> torch.logspace(start=0.1, end=1.0, steps=1)
  tensor([1.2589])
  >>> torch.logspace(start=2, end=2, steps=1, base=2)
  tensor([4.0])
max_pool2d
class torch.ao.nn.quantized.functional.max_pool2d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
Applies a 2D max pooling over a quantized input signal composed of
   several quantized input planes.
Note:
 The input quantization parameters are propagated to the output.

See "MaxPool2d" for details.
torch.signal.windows.hamming
torch.signal.windows.hamming(M, *, sym=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Computes the Hamming window.
The Hamming window is defined as follows:
  w_n = \alpha - \beta\ \cos \left( \frac{2 \pi n}{M - 1} \right)

The window is normalized to 1 (maximum value is 1). However, the 1
   doesn't appear if "M" is even and "sym" is True.
Parameters:
      M (int) -- the length of the window. In other words, the
      number of points of the returned window.
Keyword Arguments:
      * sym (bool, optional) -- If False, returns a
        periodic window suitable for use in spectral analysis. If
        True, returns a symmetric window suitable for use in filter
        design. Default: True.
  * **alpha** (*float**, **optional*) -- The coefficient \alpha in
    the equation above.

  * **beta** (*float**, **optional*) -- The coefficient \beta in