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

Note:
 "InstanceNorm1d" and "LayerNorm" are very similar, but have some
 subtle differences. "InstanceNorm1d" is applied on each channel
 of channeled data like multidimensional time series, but
 "LayerNorm" is usually applied on entire sample and often in NLP
 tasks. Additionally, "LayerNorm" applies elementwise affine
 transform, while "InstanceNorm1d" usually don't apply affine
 transform.

Parameters:


transform.
Parameters:
      * num_features (int) -- number of features or channels C
        of the input
  * **eps** (*float*) -- a value added to the denominator for
    numerical stability. Default: 1e-5

  * **momentum** (*float*) -- the value used for the running_mean
    and running_var computation. 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)

Examples:


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


TransformerEncoder
class torch.nn.TransformerEncoder(encoder_layer, num_layers, norm=None, enable_nested_tensor=True, mask_check=True)
TransformerEncoder is a stack of N encoder layers. Users can build
   the BERT(https://arxiv.org/abs/1810.04805) model with corresponding
   parameters.
Parameters:
      * encoder_layer -- an instance of the
        TransformerEncoderLayer() class (required).
  * **num_layers** -- the number of sub-encoder-layers in the
    encoder (required).

  * **norm** -- the layer normalization component (optional).

  * **enable_nested_tensor** -- if True, input will automatically
    convert to nested tensor (and convert back on output). This
    will improve the overall performance of TransformerEncoder
    when padding rate is high. Default: "True" (enabled).

Examples::
      >>> encoder_layer = nn.TransformerEncoderLayer(d_model=512, nhead=8)


transformer_encoder = nn.TransformerEncoder(encoder_layer, num_layers=6)
      >>> src = torch.rand(10, 32, 512)
      >>> out = transformer_encoder(src)

forward(src, mask=None, src_key_padding_mask=None, is_causal=None)
  Pass the input through the encoder layers in turn.

  Parameters:
     * **src** (*Tensor*) -- the sequence to the encoder
       (required).

     * **mask** (*Optional**[**Tensor**]*) -- the mask for the src
       sequence (optional).

     * **is_causal** (*Optional**[**bool**]*) -- If specified,
       applies a causal mask as mask (optional) and ignores
       attn_mask for computing scaled dot product attention.
       Default: "False".

     * **src_key_padding_mask** (*Optional**[**Tensor**]*) -- the
       mask for the src keys per batch (optional).

  Return type:
     *Tensor*

  Shape:
     see the docs in Transformer class.


torch.atan
torch.atan(input, *, out=None) -> Tensor
Returns a new tensor with the arctangent of the elements of
   "input".
  \text{out}_{i} = \tan^{-1}(\text{input}_{i})

Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4)
  >>> a
  tensor([ 0.2341,  0.2539, -0.6256, -0.6448])
  >>> torch.atan(a)
  tensor([ 0.2299,  0.2487, -0.5591, -0.5727])


LayerNorm
class torch.ao.nn.quantized.LayerNorm(normalized_shape, weight, bias, scale, zero_point, eps=1e-05, elementwise_affine=True, device=None, dtype=None)
This is the quantized version of "LayerNorm".
Additional args:
      * scale - quantization scale of the output, type: double.
  * **zero_point** - quantization zero point of the output, type:
    long.


torch.nn.functional.embedding_bag
torch.nn.functional.embedding_bag(input, weight, offsets=None, max_norm=None, norm_type=2, scale_grad_by_freq=False, mode='mean', sparse=False, per_sample_weights=None, include_last_offset=False, padding_idx=None)
Computes sums, means or maxes of bags of embeddings, without
   instantiating the intermediate embeddings.
See "torch.nn.EmbeddingBag" for more details.
Note:
 This operation may produce nondeterministic gradients when given
 tensors on a CUDA device. See Reproducibility for more
 information.

Parameters:
      * input (LongTensor) -- Tensor containing bags of indices
        into the embedding matrix
  * **weight** (*Tensor*) -- The embedding matrix with number of
    rows equal to the maximum possible index + 1, and number of
    columns equal to the embedding size

  * **offsets** (*LongTensor**, **optional*) -- Only used when


"input" is 1D. "offsets" determines the starting index
        position of each bag (sequence) in "input".
  * **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" in 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". Note: this option is
    not supported when "mode="max"".

  * **mode** (*str**, **optional*) -- ""sum"", ""mean"" or
    ""max"". Specifies the way to reduce the bag. Default:
    ""mean""

  * **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. Note: this option is not supported when
        "mode="max"".
  * **per_sample_weights** (*Tensor**, **optional*) -- a tensor of
    float / double weights, or None to indicate all weights should
    be taken to be 1. If specified, "per_sample_weights" must have
    exactly the same shape as input and is treated as having the
    same "offsets", if those are not None.

  * **include_last_offset** (*bool**, **optional*) -- if "True",
    the size of offsets is equal to the number of bags + 1. The
    last element is the size of the input, or the ending index
    position of the last bag (sequence).

  * **padding_idx** (*int**, **optional*) -- If specified, the
    entries at "padding_idx" do not contribute to the gradient;
    therefore, the embedding vector at "padding_idx" is not
    updated during training, i.e. it remains as a fixed "pad".


Note that the embedding vector at "padding_idx" is excluded
        from the reduction.
Return type:
      Tensor
Shape:
      * "input" (LongTensor) and "offsets" (LongTensor, optional)
    * If "input" is 2D of shape *(B, N)*, it will be treated as
      "B" bags (sequences) each of fixed length "N", and this will
      return "B" values aggregated in a way depending on the
      "mode". "offsets" is ignored and required to be "None" in
      this case.

    * If "input" is 1D of shape *(N)*, it will be treated as a
      concatenation of multiple bags (sequences). "offsets" is
      required to be a 1D tensor containing the starting index
      positions of each bag in "input". Therefore, for "offsets"
      of shape *(B)*, "input" will be viewed as having "B" bags.
      Empty bags (i.e., having 0-length) will have returned
      vectors filled by zeros.

  * "weight" (Tensor): the learnable weights of the module of


shape (num_embeddings, embedding_dim)
  * "per_sample_weights" (Tensor, optional). Has the same shape as
    "input".

  * "output": aggregated embedding values of shape *(B,
    embedding_dim)*

Examples:
  >>> # an Embedding module containing 10 tensors of size 3
  >>> embedding_matrix = torch.rand(10, 3)
  >>> # a batch of 2 samples of 4 indices each
  >>> input = torch.tensor([1, 2, 4, 5, 4, 3, 2, 9])
  >>> offsets = torch.tensor([0, 4])
  >>> F.embedding_bag(input, embedding_matrix, offsets)
  tensor([[ 0.3397,  0.3552,  0.5545],
          [ 0.5893,  0.4386,  0.5882]])

  >>> # example with padding_idx
  >>> embedding_matrix = torch.rand(10, 3)
  >>> input = torch.tensor([2, 2, 2, 2, 4, 3, 2, 9])
  >>> offsets = torch.tensor([0, 4])
  >>> F.embedding_bag(input, embedding_matrix, offsets, padding_idx=2, mode='sum')
  tensor([[ 0.0000,  0.0000,  0.0000],
          [-0.7082,  3.2145, -2.6251]])


torch.Tensor.cos_
Tensor.cos_() -> Tensor
In-place version of "cos()"


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


Identity
class torch.nn.Identity(args, *kwargs)
A placeholder identity operator that is argument-insensitive.
Parameters:
      * args (Any) -- any argument (unused)
  * **kwargs** (*Any*) -- any keyword argument (unused)

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

Examples:
  >>> m = nn.Identity(54, unused_argument1=0.1, unused_argument2=False)
  >>> input = torch.randn(128, 20)
  >>> output = m(input)
  >>> print(output.size())
  torch.Size([128, 20])


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


torch.Tensor.logit_
Tensor.logit_() -> Tensor
In-place version of "logit()"


torch.jit.script_if_tracing
torch.jit.script_if_tracing(fn)
Compiles "fn" when it is first called during tracing.
   "torch.jit.script" has a non-negligible start up time when it is
   first called due to lazy-initializations of many compiler builtins.
   Therefore you should not use it in library code. However, you may
   want to have parts of your library work in tracing even if they use
   control flow. In these cases, you should use
   "@torch.jit.script_if_tracing" to substitute for
   "torch.jit.script".
Parameters:
      fn -- A function to compile.
Returns:
      If called during tracing, a "ScriptFunction" created by
      torch.jit.script is returned. Otherwise, the original function
      fn is returned.


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


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


torch.Tensor.zero_
Tensor.zero_() -> Tensor
Fills "self" tensor with zeros.


torch.Tensor.split
Tensor.split(split_size, dim=0)
See "torch.split()"


Dropout3d
class torch.nn.Dropout3d(p=0.5, inplace=False)
Randomly zero out entire channels (a channel is a 3D feature map,
   e.g., the j-th channel of the i-th sample in the batched input is a
   3D tensor \text{input}[i, j]). Each channel will be zeroed out
   independently on every forward call with probability "p" using
   samples from a Bernoulli distribution.
Usually the input comes from "nn.Conv3d" modules.
As described in the paper Efficient Object Localization Using
   Convolutional Networks , if adjacent pixels within feature maps are
   strongly correlated (as is normally the case in early convolution
   layers) then i.i.d. dropout will not regularize the activations and
   will otherwise just result in an effective learning rate decrease.
In this case, "nn.Dropout3d()" will help promote independence
   between feature maps and should be used instead.
Parameters:
      * p (float, optional) -- probability of an element to
        be zeroed.


be zeroed.
  * **inplace** (*bool**, **optional*) -- If set to "True", will
    do this operation in-place

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

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


ASGD
class torch.optim.ASGD(params, lr=0.01, lambd=0.0001, alpha=0.75, t0=1000000.0, weight_decay=0, foreach=None, maximize=False, differentiable=False)
Implements Averaged Stochastic Gradient Descent.
It has been proposed in Acceleration of stochastic approximation by
   averaging.
Parameters:
      * params (iterable) -- iterable of parameters to optimize
        or dicts defining parameter groups
  * **lr** (*float**, **optional*) -- learning rate (default:
    1e-2)

  * **lambd** (*float**, **optional*) -- decay term (default:
    1e-4)

  * **alpha** (*float**, **optional*) -- power for eta update
    (default: 0.75)

  * **t0** (*float**, **optional*) -- point at which to start
    averaging (default: 1e6)

  * **weight_decay** (*float**, **optional*) -- weight decay (L2
    penalty) (default: 0)

  * **foreach** (*bool**, **optional*) -- whether foreach
    implementation of optimizer is used. If unspecified by the


user (so foreach is None), we will try to use foreach over the
        for-loop implementation on CUDA, since it is usually
        significantly more performant. (default: None)
  * **maximize** (*bool**, **optional*) -- maximize the params
    based on the objective, instead of minimizing (default: False)

  * **differentiable** (*bool**, **optional*) -- whether autograd
    should occur through the optimizer step in training.
    Otherwise, the step() function runs in a torch.no_grad()
    context. Setting to True can impair performance, so leave it
    False if you don't intend to run autograd through this
    instance (default: False)

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:


as training progresses.
  Parameters:
     **param_group** (*dict*) -- Specifies what Tensors should be
     optimized along with group specific optimization options.

load_state_dict(state_dict)
  Loads the optimizer state.

  Parameters:
     **state_dict** (*dict*) -- optimizer state. Should be an
     object returned from a call to "state_dict()".

register_step_post_hook(hook)
  Register an optimizer step post hook which will be called after
  optimizer step. It should have the following signature:

     hook(optimizer, args, kwargs) -> None

  The "optimizer" argument is the optimizer instance being used.

  Parameters:
     **hook** (*Callable*) -- The user defined hook to be
     registered.

  Returns:
     a handle that can be used to remove the added hook by calling
     "handle.remove()"

  Return type:
     "torch.utils.hooks.RemoveableHandle"

register_step_pre_hook(hook)


register_step_pre_hook(hook)
  Register an optimizer step pre hook which will be called before
  optimizer step. It should have the following signature:

     hook(optimizer, args, kwargs) -> None or modified args and kwargs

  The "optimizer" argument is the optimizer instance being used.
  If args and kwargs are modified by the pre-hook, then the
  transformed values are returned as a tuple containing the
  new_args and new_kwargs.

  Parameters:
     **hook** (*Callable*) -- The user defined hook to be
     registered.

  Returns:
     a handle that can be used to remove the added hook by calling
     "handle.remove()"

  Return type:
     "torch.utils.hooks.RemoveableHandle"

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

  It contains two entries:

  * state - a dict holding current optimization state. Its content
       differs between optimizer classes.


differs between optimizer classes.
  * param_groups - a list containing all parameter groups where
    each
       parameter group is a dict

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.squeeze
torch.squeeze(input, dim=None) -> Tensor
Returns a tensor with all specified dimensions of "input" of size
   1 removed.
For example, if input is of shape: (A \times 1 \times B \times C
   \times 1 \times D) then the input.squeeze() will be of shape: (A
   \times B \times C \times D).
When "dim" is given, a squeeze operation is done only in the given
   dimension(s). If input is of shape: (A \times 1 \times B),
   "squeeze(input, 0)" leaves the tensor unchanged, but
   "squeeze(input, 1)" will squeeze the tensor to the shape (A \times
   B).
Note:
 The returned tensor shares the storage with the input tensor, so
 changing the contents of one will change the contents of the
 other.

Warning:
 If the tensor has a batch dimension of size 1, then
 *squeeze(input)* will also remove the batch dimension, which can
 lead to unexpected errors. Consider specifying only the dims you
 wish to be squeezed.

Parameters:


wish to be squeezed.
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int** or **tuple of ints**, **optional*) --

    if given, the input will be squeezed
       only in the specified dimensions.

    Changed in version 2.0: "dim" now accepts tuples of
    dimensions.

Example:
  >>> x = torch.zeros(2, 1, 2, 1, 2)
  >>> x.size()
  torch.Size([2, 1, 2, 1, 2])
  >>> y = torch.squeeze(x)
  >>> y.size()
  torch.Size([2, 2, 2])
  >>> y = torch.squeeze(x, 0)
  >>> y.size()
  torch.Size([2, 1, 2, 1, 2])
  >>> y = torch.squeeze(x, 1)
  >>> y.size()
  torch.Size([2, 2, 1, 2])
  >>> y = torch.squeeze(x, (1, 2, 3))
  torch.Size([2, 2, 2])


torch.cuda.empty_cache
torch.cuda.empty_cache()
Releases all unoccupied cached memory currently held by the caching
   allocator so that those can be used in other GPU application and
   visible in nvidia-smi.
Note:
 "empty_cache()" doesn't increase the amount of GPU memory
 available for PyTorch. However, it may help reduce fragmentation
 of GPU memory in certain cases. See Memory management for more
 details about GPU memory management.


torch.is_deterministic_algorithms_warn_only_enabled
torch.is_deterministic_algorithms_warn_only_enabled()
Returns True if the global deterministic flag is set to warn only.
   Refer to "torch.use_deterministic_algorithms()" documentation for
   more details.


torch.Tensor.sub_
Tensor.sub_(other, *, alpha=1) -> Tensor
In-place version of "sub()"


torch.nn.utils.rnn.pack_sequence
torch.nn.utils.rnn.pack_sequence(sequences, enforce_sorted=True)
Packs a list of variable length Tensors
Consecutive call of the next functions: "pad_sequence",
   "pack_padded_sequence".
"sequences" should be a list of Tensors of size "L x ", where L*
   is the length of a sequence and *** is any number of trailing
   dimensions, including zero.
For unsorted sequences, use enforce_sorted = False. If
   "enforce_sorted" is "True", the sequences should be sorted in the
   order of decreasing length. "enforce_sorted = True" is only
   necessary for ONNX export.
-[ Example ]-

from torch.nn.utils.rnn import pack_sequence
a = torch.tensor([1, 2, 3])
b = torch.tensor([4, 5])
c = torch.tensor([6])
pack_sequence([a, b, c])
   PackedSequence(data=tensor([1, 4, 6, 2, 5, 3]), batch_sizes=tensor([3, 2, 1]), sorted_indices=None, unsorted_indices=None)

Parameters:


Parameters:
      * sequences (list[Tensor]) -- A list of sequences of
        decreasing length.
  * **enforce_sorted** (*bool**, **optional*) -- if "True", checks
    that the input contains sequences sorted by length in a
    decreasing order. If "False", this condition is not checked.
    Default: "True".

Returns:
      a "PackedSequence" object
Return type:
      PackedSequence


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


torch.Tensor.moveaxis
Tensor.moveaxis(source, destination) -> Tensor
See "torch.moveaxis()"


torch.Tensor.gcd_
Tensor.gcd_(other) -> Tensor
In-place version of "gcd()"


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


torch.Tensor.resize_as_
Tensor.resize_as_(tensor, memory_format=torch.contiguous_format) -> Tensor
Resizes the "self" tensor to be the same size as the specified
   "tensor". This is equivalent to "self.resize_(tensor.size())".
Parameters:
      memory_format ("torch.memory_format", optional) -- the
      desired memory format of Tensor. Default:
      "torch.contiguous_format". Note that memory format of "self" is
      going to be unaffected if "self.size()" matches "tensor.size()".


torch.Tensor.round
Tensor.round(decimals=0) -> Tensor
See "torch.round()"


torch.empty_strided
torch.empty_strided(size, stride, *, dtype=None, layout=None, device=None, requires_grad=False, pin_memory=False) -> Tensor
Creates a tensor with the specified "size" and "stride" and filled
   with undefined data.
Warning:
 If the constructed tensor is "overlapped" (with multiple indices
 referring to the same element in memory) its behavior is
 undefined.

Parameters:
      * size (tuple of python:int) -- the shape of the output
        tensor
  * **stride** (*tuple of python:int*) -- the strides of the
    output tensor

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()").
  * **layout** ("torch.layout", optional) -- the desired layout of
    returned Tensor. Default: "torch.strided".

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


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

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

Example:
  >>> a = torch.empty_strided((2, 3), (1, 2))
  >>> a
  tensor([[8.9683e-44, 4.4842e-44, 5.1239e+07],
          [0.0000e+00, 0.0000e+00, 3.0705e-41]])
  >>> a.stride()
  (1, 2)
  >>> a.size()
  torch.Size([2, 3])


torch.Tensor.absolute
Tensor.absolute() -> Tensor
Alias for "abs()"


torch.nn.functional.ctc_loss
torch.nn.functional.ctc_loss(log_probs, targets, input_lengths, target_lengths, blank=0, reduction='mean', zero_infinity=False)
The Connectionist Temporal Classification loss.
See "CTCLoss" for details.
Note:
 In some circumstances when given tensors on a CUDA device and
 using CuDNN, this operator may select a nondeterministic
 algorithm to increase performance. If this is undesirable, you
 can try to make the operation deterministic (potentially at a
 performance cost) by setting "torch.backends.cudnn.deterministic
 = True". See Reproducibility for more information.

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

Parameters:
      * log_probs (Tensor) -- (T, N, C) or (T, C) where C =
        number of characters in alphabet including blank, *T = input


length, and N = batch size*. The logarithmized probabilities
        of the outputs (e.g. obtained with
        "torch.nn.functional.log_softmax()").
  * **targets** (*Tensor*) -- (N, S) or *(sum(target_lengths))*.
    Targets cannot be blank. In the second form, the targets are
    assumed to be concatenated.

  * **input_lengths** (*Tensor*) -- (N) or (). Lengths of the
    inputs (must each be \leq T)

  * **target_lengths** (*Tensor*) -- (N) or (). Lengths of the
    targets

  * **blank** (*int**, **optional*) -- Blank label. Default 0.

  * **reduction** (*str**, **optional*) -- Specifies the reduction
    to apply to the output: "'none'" | "'mean'" | "'sum'".
    "'none'": no reduction will be applied, "'mean'": the output
    losses will be divided by the target lengths and then the mean
    over the batch is taken, "'sum'": the output will be summed.
    Default: "'mean'"


Default: "'mean'"
  * **zero_infinity** (*bool**, **optional*) -- Whether to zero
    infinite losses and the associated gradients. Default: "False"
    Infinite losses mainly occur when the inputs are too short to
    be aligned to the targets.

Return type:
      Tensor
Example:
  >>> log_probs = torch.randn(50, 16, 20).log_softmax(2).detach().requires_grad_()
  >>> targets = torch.randint(1, 20, (16, 30), dtype=torch.long)
  >>> input_lengths = torch.full((16,), 50, dtype=torch.long)
  >>> target_lengths = torch.randint(10, 30, (16,), dtype=torch.long)
  >>> loss = F.ctc_loss(log_probs, targets, input_lengths, target_lengths)
  >>> loss.backward()


torch.mm
torch.mm(input, mat2, *, out=None) -> Tensor
Performs a matrix multiplication of the matrices "input" and
   "mat2".
If "input" is a (n \times m) tensor, "mat2" is a (m \times p)
   tensor, "out" will be a (n \times p) tensor.
Note:
 This function does not broadcast. For broadcasting matrix
 products, see "torch.matmul()".

Supports strided and sparse 2-D tensors as inputs, autograd with
   respect to strided inputs.
This operation has support for arguments with sparse layouts. If
   "out" is provided it's layout will be used. Otherwise, the result
   layout will be deduced from that of "input".
Warning:
 Sparse support is a beta feature and some layout(s)/dtype/device
 combinations may not be supported, or may not have autograd
 support. If you notice missing functionality please open a
 feature request.

This operator supports TensorFloat32.
On certain ROCm devices, when using float16 inputs this module will


use different precision for backward.
Parameters:
      * input (Tensor) -- the first matrix to be matrix
        multiplied
  * **mat2** (*Tensor*) -- the second matrix to be matrix
    multiplied

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> mat1 = torch.randn(2, 3)
  >>> mat2 = torch.randn(3, 3)
  >>> torch.mm(mat1, mat2)
  tensor([[ 0.4851,  0.5037, -0.3633],
          [-0.0760, -3.6705,  2.4784]])


torch.le
torch.le(input, other, *, out=None) -> Tensor
Computes \text{input} \leq \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 **Scalar*) -- 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 or
      equal to "other" and False elsewhere
Example:
  >>> torch.le(torch.tensor([[1, 2], [3, 4]]), torch.tensor([[1, 1], [4, 4]]))
  tensor([[True, False], [True, True]])


torch.Tensor.imag
Tensor.imag
Returns a new tensor containing imaginary values of the "self"
   tensor. The returned tensor and "self" share the same underlying
   storage.
Warning:
 "imag()" is only supported for tensors with complex dtypes.

Example::
      >>> x=torch.randn(4, dtype=torch.cfloat)
      >>> x
      tensor([(0.3100+0.3553j), (-0.5445-0.7896j), (-1.6492-0.0633j), (-0.0638-0.8119j)])
      >>> x.imag
      tensor([ 0.3553, -0.7896, -0.0633, -0.8119])


torch.nn.utils.prune.identity
torch.nn.utils.prune.identity(module, name)
Applies pruning reparametrization to the tensor corresponding to
   the parameter called "name" in "module" without actually pruning
   any units. Modifies module in place (and also return the modified
   module) by:

adding a named buffer called "name+'_mask'" corresponding to the
      binary mask applied to the parameter "name" by the pruning
      method.

replacing the parameter "name" by its pruned version, while the
      original (unpruned) parameter is stored in a new parameter named
      "name+'_orig'".

Note:
 The mask is a tensor of ones.

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

Returns:
      modified (i.e. pruned) version of the input module
Return type:
      module (nn.Module)
-[ Examples ]-


module (nn.Module)
-[ Examples ]-

m = prune.identity(nn.Linear(2, 3), 'bias')
print(m.bias_mask)
   tensor([1., 1., 1.])


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


Mish
class torch.nn.Mish(inplace=False)
Applies the Mish function, element-wise. Mish: A Self Regularized
   Non-Monotonic Neural Activation Function.
  \text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))

Note:
 See Mish: A Self Regularized Non-Monotonic Neural Activation
 Function

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

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


torch.nn.functional.elu_
torch.nn.functional.elu_(input, alpha=1.) -> Tensor
In-place version of "elu()".


torch.cos
torch.cos(input, *, out=None) -> Tensor
Returns a new tensor with the cosine  of the elements of "input".
  \text{out}_{i} = \cos(\text{input}_{i})

Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4)
  >>> a
  tensor([ 1.4309,  1.2706, -0.8562,  0.9796])
  >>> torch.cos(a)
  tensor([ 0.1395,  0.2957,  0.6553,  0.5574])


torch.Tensor.addr_
Tensor.addr_(vec1, vec2, *, beta=1, alpha=1) -> Tensor
In-place version of "addr()"


torch.logit
torch.logit(input, eps=None, *, out=None) -> Tensor
Alias for "torch.special.logit()".


torch.Tensor.ne_
Tensor.ne_(other) -> Tensor
In-place version of "ne()".


torch.Tensor.renorm
Tensor.renorm(p, dim, maxnorm) -> Tensor
See "torch.renorm()"


torch.nn.functional.l1_loss
torch.nn.functional.l1_loss(input, target, size_average=None, reduce=None, reduction='mean') -> Tensor
Function that takes the mean element-wise absolute value
   difference.
See "L1Loss" for details.
Return type:
      Tensor


torch.nn.functional.celu
torch.nn.functional.celu(input, alpha=1., inplace=False) -> Tensor
Applies element-wise, \text{CELU}(x) = \max(0,x) + \min(0, \alpha *
   (\exp(x/\alpha) - 1)).
See "CELU" for more details.
Return type:
      Tensor


torch.cuda.jiterator._create_multi_output_jit_fn
torch.cuda.jiterator._create_multi_output_jit_fn(code_string, num_outputs, **kwargs)
Create a jiterator-generated cuda kernel for an elementwise op that
   supports returning one or more outputs.
Parameters:
      * code_string (str) -- CUDA code string to be compiled by
        jiterator. The entry functor must return value by reference.
  * **num_outputs** (*int*) -- number of outputs return by the
    kernel

  * **kwargs** (*Dict**, **optional*) -- Keyword arguments for
    generated function

Return type:
      Callable
Example:
  code_string = "template <typename T> void my_kernel(T x, T y, T alpha, T& out) { out = -x + alpha * y; }"
  jitted_fn = create_jit_fn(code_string, alpha=1.0)
  a = torch.rand(3, device='cuda')
  b = torch.rand(3, device='cuda')
  # invoke jitted function like a regular python function


result = jitted_fn(a, b, alpha=3.14)
Warning:
 This API is in beta and may change in future releases.

Warning:
 This API only supports up to 8 inputs and 8 outputs


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


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

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

  * **padding** (*int** or **tuple**, **optional*) -- Zero-padding
    added to both sides of the input. Default: 0

  * **padding_mode** (*str**, **optional*) -- "'zeros'",


"'reflect'", "'replicate'" or "'circular'". Default: "'zeros'"
  * **dilation** (*int** or **tuple**, **optional*) -- Spacing
    between kernel elements. Default: 1

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

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

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

cls_to_become
  alias of "Conv3d"


torch.ger
torch.ger(input, vec2, *, out=None) -> Tensor
Alias of "torch.outer()".
Warning:
 This function is deprecated and will be removed in a future
 PyTorch release. Use "torch.outer()" instead.


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


torch.nn.functional.conv_transpose2d
torch.nn.functional.conv_transpose2d(input, weight, bias=None, stride=1, padding=0, output_padding=0, groups=1, dilation=1) -> Tensor
Applies a 2D transposed convolution operator over an input image
   composed of several input planes, sometimes also called
   "deconvolution".
This operator supports TensorFloat32.
See "ConvTranspose2d" for details and output shape.
Note:
 In some circumstances when given tensors on a CUDA device and
 using CuDNN, this operator may select a nondeterministic
 algorithm to increase performance. If this is undesirable, you
 can try to make the operation deterministic (potentially at a
 performance cost) by setting "torch.backends.cudnn.deterministic
 = True". See Reproducibility for more information.

Parameters:
      * input -- input tensor of shape (\text{minibatch} ,
        \text{in_channels} , iH , iW)


\text{in_channels} , iH , iW)
  * **weight** -- filters of shape (\text{in\_channels} ,
    \frac{\text{out\_channels}}{\text{groups}} , kH , kW)

  * **bias** -- optional bias of shape (\text{out\_channels}).
    Default: None

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

  * **padding** -- "dilation * (kernel_size - 1) - padding" zero-
    padding will be added to both sides of each dimension in the
    input. Can be a single number or a tuple "(padH, padW)".
    Default: 0

  * **output_padding** -- additional size added to one side of
    each dimension in the output shape. Can be a single number or
    a tuple "(out_padH, out_padW)". Default: 0

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

  * **dilation** -- the spacing between kernel elements. Can be a


single number or a tuple "(dH, dW)". Default: 1
Examples:
  >>> # With square kernels and equal stride
  >>> inputs = torch.randn(1, 4, 5, 5)
  >>> weights = torch.randn(4, 8, 3, 3)
  >>> F.conv_transpose2d(inputs, weights, padding=1)


torch.nn.utils.parametrize.remove_parametrizations
torch.nn.utils.parametrize.remove_parametrizations(module, tensor_name, leave_parametrized=True)
Removes the parametrizations on a tensor in a module.

If "leave_parametrized=True", "module[tensor_name]" will be set
     to its current output. In this case, the parametrization shall
     not change the "dtype" of the tensor.

If "leave_parametrized=False", "module[tensor_name]" will be set
     to the unparametrised tensor in
     "module.parametrizations[tensor_name].original". This is only
     possible when the parametrization depends on just one tensor.

Parameters:
      * module (nn.Module) -- module from which remove the
        parametrization
  * **tensor_name** (*str*) -- name of the parametrization to be
    removed

  * **leave_parametrized** (*bool**, **optional*) -- leave the
    attribute "tensor_name" parametrized. Default: "True"

Returns:


Returns:
      module
Return type:
      Module
Raises:
      * ValueError -- if "module[tensor_name]" is not parametrized
  * **ValueError** -- if "leave_parametrized=False" and the
    parametrization depends on several tensors


torch.Tensor.q_per_channel_axis
Tensor.q_per_channel_axis() -> int
Given a Tensor quantized by linear (affine) per-channel
   quantization, returns the index of dimension on which per-channel
   quantization is applied.


torch.Tensor.triu_
Tensor.triu_(diagonal=0) -> Tensor
In-place version of "triu()"


RandomUnstructured
class torch.nn.utils.prune.RandomUnstructured(amount)
Prune (currently unpruned) units in a tensor at random.
Parameters:
      * name (str) -- parameter name within "module" on which
        pruning will act.
  * **amount** (*int** or **float*) -- quantity of parameters to
    prune. If "float", should be between 0.0 and 1.0 and represent
    the fraction of parameters to prune. If "int", it represents
    the absolute number of parameters to prune.

classmethod apply(module, name, amount)
  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.

     * **amount** (*int** or **float*) -- quantity of parameters


to prune. If "float", should be between 0.0 and 1.0 and
           represent the fraction of parameters to prune. If "int", it
           represents the absolute number of parameters to prune.
apply_mask(module)
  Simply handles the multiplication between the parameter being
  pruned and the generated mask. Fetches the mask and the original
  tensor from the module and returns the pruned version of the
  tensor.

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

  Returns:
     pruned version of the input tensor

  Return type:
     pruned_tensor (torch.Tensor)

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

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


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!


RNNCell
class torch.nn.RNNCell(input_size, hidden_size, bias=True, nonlinearity='tanh', device=None, dtype=None)
An Elman RNN cell with tanh or ReLU non-linearity.
  h' = \tanh(W_{ih} x + b_{ih}  +  W_{hh} h + b_{hh})

If "nonlinearity" is 'relu', then ReLU is used in place of tanh.
Parameters:
      * input_size (int) -- The number of expected features in
        the input x
  * **hidden_size** (*int*) -- The number of features in the
    hidden state *h*

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

  * **nonlinearity** (*str*) -- The non-linearity to use. Can be
    either "'tanh'" or "'relu'". Default: "'tanh'"

Inputs: input, hidden
      * input: tensor containing input features
  * **hidden**: tensor containing the initial hidden state
    Defaults to zero if not provided.

Outputs: h'


Outputs: h'
      * h' of shape (batch, hidden_size): tensor containing the
        next hidden state for each element in the batch
Shape:
      * input: (N, H_{in}) or (H_{in}) tensor containing input
        features where H_{in} = input_size.
  * hidden: (N, H_{out}) or (H_{out}) tensor containing the
    initial hidden state where H_{out} = *hidden_size*. Defaults
    to zero if not provided.

  * output: (N, H_{out}) or (H_{out}) tensor containing the next
    hidden state.

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

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

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

Note:


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

Examples:
  >>> rnn = nn.RNNCell(10, 20)
  >>> input = torch.randn(6, 3, 10)
  >>> hx = torch.randn(3, 20)
  >>> output = []
  >>> for i in range(6):
  ...     hx = rnn(input[i], hx)
  ...     output.append(hx)


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


torch.diagonal_scatter
torch.diagonal_scatter(input, src, offset=0, dim1=0, dim2=1) -> Tensor
Embeds the values of the "src" tensor into "input" along the
   diagonal elements of "input", with respect to "dim1" and "dim2".
This function returns a tensor with fresh storage; it does not
   return a view.
The argument "offset" controls which diagonal to consider:

If "offset" = 0, it is the main diagonal.

If "offset" > 0, it is above the main diagonal.

If "offset" < 0, it is below the main diagonal.

Parameters:
      * input (Tensor) -- the input tensor. Must be at least
        2-dimensional.
  * **src** (*Tensor*) -- the tensor to embed into "input".

  * **offset** (*int**, **optional*) -- which diagonal to
    consider. Default: 0 (main diagonal).

  * **dim1** (*int**, **optional*) -- first dimension with respect
    to which to take diagonal. Default: 0.

  * **dim2** (*int**, **optional*) -- second dimension with


respect to which to take diagonal. Default: 1.
Note:
 "src" must be of the proper size in order to be embedded into
 "input". Specifically, it should have the same shape as
 "torch.diagonal(input, offset, dim1, dim2)"

Examples:
  >>> a = torch.zeros(3, 3)
  >>> a
  tensor([[0., 0., 0.],
          [0., 0., 0.],
          [0., 0., 0.]])

  >>> torch.diagonal_scatter(a, torch.ones(3), 0)
  tensor([[1., 0., 0.],
          [0., 1., 0.],
          [0., 0., 1.]])

  >>> torch.diagonal_scatter(a, torch.ones(2), 1)
  tensor([[0., 1., 0.],
          [0., 0., 1.],
          [0., 0., 0.]])


torch.nn.utils.prune.l1_unstructured
torch.nn.utils.prune.l1_unstructured(module, name, amount, importance_scores=None)
Prunes tensor corresponding to parameter called "name" in "module"
   by removing the specified amount of (currently unpruned) units
   with the lowest L1-norm. Modifies module in place (and also return
   the modified module) by:

adding a named buffer called "name+'_mask'" corresponding to the
      binary mask applied to the parameter "name" by the pruning
      method.

replacing the parameter "name" by its pruned version, while the
      original (unpruned) parameter is stored in a new parameter named
      "name+'_orig'".

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

  * **amount** (*int** or **float*) -- quantity of parameters to


prune. If "float", should be between 0.0 and 1.0 and represent
        the fraction of parameters to prune. If "int", it represents
        the absolute number of parameters to prune.
  * **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 module parameter
    will be used in its place.

Returns:
      modified (i.e. pruned) version of the input module
Return type:
      module (nn.Module)
-[ Examples ]-

m = prune.l1_unstructured(nn.Linear(2, 3), 'weight', amount=0.2)
m.state_dict().keys()
   odict_keys(['bias', 'weight_orig', 'weight_mask'])


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


torch.lgamma
torch.lgamma(input, *, out=None) -> Tensor
Computes the natural logarithm of the absolute value of the gamma
   function on "input".
  \text{out}_{i} = \ln \Gamma(|\text{input}_{i}|)

Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.arange(0.5, 2, 0.5)
  >>> torch.lgamma(a)
  tensor([ 0.5724,  0.0000, -0.1208])


torch.gather
torch.gather(input, dim, index, *, sparse_grad=False, out=None) -> Tensor
Gathers values along an axis specified by dim.
For a 3-D tensor the output is specified by:
  out[i][j][k] = input[index[i][j][k]][j][k]  # if dim == 0
  out[i][j][k] = input[i][index[i][j][k]][k]  # if dim == 1
  out[i][j][k] = input[i][j][index[i][j][k]]  # if dim == 2

"input" and "index" must have the same number of dimensions. It is
   also required that "index.size(d) <= input.size(d)" for all
   dimensions "d != dim".  "out" will have the same shape as "index".
   Note that "input" and "index" do not broadcast against each other.
Parameters:
      * input (Tensor) -- the source tensor
  * **dim** (*int*) -- the axis along which to index

  * **index** (*LongTensor*) -- the indices of elements to gather

Keyword Arguments:
      * sparse_grad (bool, optional) -- If "True", gradient
        w.r.t. "input" will be a sparse tensor.


w.r.t. "input" will be a sparse tensor.
  * **out** (*Tensor**, **optional*) -- the destination tensor

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


torch.quantize_per_channel
torch.quantize_per_channel(input, scales, zero_points, axis, dtype) -> Tensor
Converts a float tensor to a per-channel quantized tensor with
   given scales and zero points.
Parameters:
      * input (Tensor) -- float tensor to quantize
  * **scales** (*Tensor*) -- float 1D tensor of scales to use,
    size should match "input.size(axis)"

  * **zero_points** (*int*) -- integer 1D tensor of offset to use,
    size should match "input.size(axis)"

  * **axis** (*int*) -- dimension on which apply per-channel
    quantization

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

Returns:
      A newly quantized tensor
Return type:
      Tensor
Example:
  >>> x = torch.tensor([[-1.0, 0.0], [1.0, 2.0]])


torch.quantize_per_channel(x, torch.tensor([0.1, 0.01]), torch.tensor([10, 0]), 0, torch.quint8)
      tensor([[-1.,  0.],
              [ 1.,  2.]], size=(2, 2), dtype=torch.quint8,
             quantization_scheme=torch.per_channel_affine,
             scale=tensor([0.1000, 0.0100], dtype=torch.float64),
             zero_point=tensor([10,  0]), axis=0)
      >>> torch.quantize_per_channel(x, torch.tensor([0.1, 0.01]), torch.tensor([10, 0]), 0, torch.quint8).int_repr()
      tensor([[  0,  10],
              [100, 200]], dtype=torch.uint8)


torch.signal.windows.blackman
torch.signal.windows.blackman(M, *, sym=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Computes the Blackman window.
The Blackman window is defined as follows:
  w_n = 0.42 - 0.5 \cos \left( \frac{2 \pi n}{M - 1} \right) +
  0.08 \cos \left( \frac{4 \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.
  * **dtype** ("torch.dtype", optional) -- the desired data type


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

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

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

Return type:
      Tensor
Examples:
  >>> # Generates a symmetric Blackman window.
  >>> torch.signal.windows.blackman(5)
  tensor([-1.4901e-08,  3.4000e-01,  1.0000e+00,  3.4000e-01, -1.4901e-08])

  >>> # Generates a periodic Blackman window.


Generates a periodic Blackman window.
  >>> torch.signal.windows.blackman(5, sym=False)
  tensor([-1.4901e-08,  2.0077e-01,  8.4923e-01,  8.4923e-01,  2.0077e-01])


torch.nn.functional.softsign
torch.nn.functional.softsign(input) -> Tensor
Applies element-wise, the function \text{SoftSign}(x) = \frac{x}{1
   + |x|}
See "Softsign" for more details.


Event
class torch.cuda.Event(enable_timing=False, blocking=False, interprocess=False)
Wrapper around a CUDA event.
CUDA events are synchronization markers that can be used to monitor
   the device's progress, to accurately measure timing, and to
   synchronize CUDA streams.
The underlying CUDA events are lazily initialized when the event is
   first recorded or exported to another process. After creation, only
   streams on the same device may record the event. However, streams
   on any device can wait on the event.
Parameters:
      * enable_timing (bool, optional) -- indicates if the
        event should measure time (default: "False")
  * **blocking** (*bool**, **optional*) -- if "True", "wait()"
    will be blocking (default: "False")

  * **interprocess** (*bool*) -- if "True", the event can be
    shared between processes (default: "False")

elapsed_time(end_event)
  Returns the time elapsed in milliseconds after the event was


recorded and before the end_event was recorded.
classmethod from_ipc_handle(device, handle)
  Reconstruct an event from an IPC handle on the given device.

ipc_handle()
  Returns an IPC handle of this event. If not recorded yet, the
  event will use the current device.

query()
  Checks if all work currently captured by event has completed.

  Returns:
     A boolean indicating if all work currently captured by event
     has completed.

record(stream=None)
  Records the event in a given stream.

  Uses "torch.cuda.current_stream()" if no stream is specified.
  The stream's device must match the event's device.

synchronize()
  Waits for the event to complete.

  Waits until the completion of all work currently captured in
  this event. This prevents the CPU thread from proceeding until
  the event completes.

     Note:

       This is a wrapper around "cudaEventSynchronize()": see CUDA


Event documentation for more info.
wait(stream=None)
  Makes all future work submitted to the given stream wait for
  this event.

  Use "torch.cuda.current_stream()" if no stream is specified.

  Note:

    This is a wrapper around "cudaStreamWaitEvent()": see CUDA
    Event documentation for more info.


torch.argsort
torch.argsort(input, dim=- 1, descending=False, stable=False) -> Tensor
Returns the indices that sort a tensor along a given dimension in
   ascending order by value.
This is the second value returned by "torch.sort()".  See its
   documentation for the exact semantics of this method.
If "stable" is "True" then the sorting routine becomes stable,
   preserving the order of equivalent elements. If "False", the
   relative order of values which compare equal is not guaranteed.
   "True" is slower.
Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int**, **optional*) -- the dimension to sort along

  * **descending** (*bool**, **optional*) -- controls the sorting
    order (ascending or descending)

  * **stable** (*bool**, **optional*) -- controls the relative
    order of equivalent elements

Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[ 0.0785,  1.5267, -0.8521,  0.4065],


[ 0.1598,  0.0788, -0.0745, -1.2700],
              [ 1.2208,  1.0722, -0.7064,  1.2564],
              [ 0.0669, -0.2318, -0.8229, -0.9280]])
  >>> torch.argsort(a, dim=1)
  tensor([[2, 0, 3, 1],
          [3, 2, 1, 0],
          [2, 1, 0, 3],
          [3, 2, 1, 0]])


torch.is_grad_enabled
torch.is_grad_enabled()
Returns True if grad mode is currently enabled.


CosineEmbeddingLoss
class torch.nn.CosineEmbeddingLoss(margin=0.0, size_average=None, reduce=None, reduction='mean')
Creates a criterion that measures the loss given input tensors x_1,
   x_2 and a Tensor label y with values 1 or -1. This is used for
   measuring whether two inputs are similar or dissimilar, using the
   cosine similarity, and is typically used for learning nonlinear
   embeddings or semi-supervised learning.
The loss function for each sample is:
  \text{loss}(x, y) = \begin{cases} 1 - \cos(x_1, x_2), & \text{if
  } y = 1 \\ \max(0, \cos(x_1, x_2) - \text{margin}), & \text{if }
  y = -1 \end{cases}

Parameters:
      * margin (float, optional) -- Should be a number from
        -1 to 1, 0 to 0.5 is suggested. If "margin" is missing, the
        default value is 0.
  * **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:
      * Input1: (N, D) or (D), where N is the batch size and D is
        the embedding dimension.
  * Input2: (N, D) or (D), same shape as Input1.

  * Target: (N) or ().

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


torch.arccosh
torch.arccosh(input, *, out=None) -> Tensor
Alias for "torch.acosh()".


ConvReLU2d
class torch.ao.nn.intrinsic.qat.ConvReLU2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', qconfig=None)
A ConvReLU2d module is a fused module of Conv2d and ReLU, attached
   with FakeQuantize modules for weight for quantization aware
   training.
We combined the interface of "Conv2d" and "BatchNorm2d".
Variables:
      weight_fake_quant -- fake quant module for weight


torch.vstack
torch.vstack(tensors, *, out=None) -> Tensor
Stack tensors in sequence vertically (row wise).
This is equivalent to concatenation along the first axis after all
   1-D tensors have been reshaped by "torch.atleast_2d()".
Parameters:
      tensors (sequence of Tensors) -- sequence of tensors to
      concatenate
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.tensor([1, 2, 3])
  >>> b = torch.tensor([4, 5, 6])
  >>> torch.vstack((a,b))
  tensor([[1, 2, 3],
          [4, 5, 6]])
  >>> a = torch.tensor([[1],[2],[3]])
  >>> b = torch.tensor([[4],[5],[6]])
  >>> torch.vstack((a,b))
  tensor([[1],
          [2],
          [3],
          [4],
          [5],
          [6]])


torch.flip
torch.flip(input, dims) -> Tensor
Reverse the order of an n-D tensor along given axis in dims.
Note:
 *torch.flip* makes a copy of "input"'s data. This is different
 from NumPy's *np.flip*, which returns a view in constant time.
 Since copying a tensor's data is more work than viewing that
 data, *torch.flip* is expected to be slower than *np.flip*.

Parameters:
      * input (Tensor) -- the input tensor.
  * **dims** (*a list** or **tuple*) -- axis to flip on

Example:
  >>> x = torch.arange(8).view(2, 2, 2)
  >>> x
  tensor([[[ 0,  1],
           [ 2,  3]],

          [[ 4,  5],
           [ 6,  7]]])
  >>> torch.flip(x, [0, 1])
  tensor([[[ 6,  7],
           [ 4,  5]],

          [[ 2,  3],
           [ 0,  1]]])


torch.Tensor.frexp
Tensor.frexp(input) -> (Tensor mantissa, Tensor exponent)
See "torch.frexp()"


torch.median
torch.median(input) -> Tensor
Returns the median of the values in "input".
Note:
 The median is not unique for "input" tensors with an even number
 of elements. In this case the lower of the two medians is
 returned. To compute the mean of both medians, use
 "torch.quantile()" with "q=0.5" instead.

Warning:
 This function produces deterministic (sub)gradients unlike
 "median(dim=0)"

Parameters:
      input (Tensor) -- the input tensor.
Example:
  >>> a = torch.randn(1, 3)
  >>> a
  tensor([[ 1.5219, -1.5212,  0.2202]])
  >>> torch.median(a)
  tensor(0.2202)

torch.median(input, dim=- 1, keepdim=False, *, out=None)
Returns a namedtuple "(values, indices)" where "values" contains
   the median of each row of "input" in the dimension "dim", and
   "indices" contains the index of the median values found in the
   dimension "dim".
By default, "dim" is the last dimension of the "input" tensor.


If "keepdim" is "True", the output tensors are of the same size as
   "input" except in the dimension "dim" where they are of size 1.
   Otherwise, "dim" is squeezed (see "torch.squeeze()"), resulting in
   the outputs tensor having 1 fewer dimension than "input".
Note:
 The median is not unique for "input" tensors with an even number
 of elements in the dimension "dim". In this case the lower of the
 two medians is returned. To compute the mean of both medians in
 "input", use "torch.quantile()" with "q=0.5" instead.

Warning:
 "indices" does not necessarily contain the first occurrence of
 each median value found, unless it is unique. The exact
 implementation details are device-specific. Do not expect the
 same result when run on CPU and GPU in general. For the same
 reason do not expect the gradients to be deterministic.

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


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

Keyword Arguments:
      out ((Tensor, Tensor), optional) -- The first
      tensor will be populated with the median values and the second
      tensor, which must have dtype long, with their indices in the
      dimension "dim" of "input".
Example:
  >>> a = torch.randn(4, 5)
  >>> a
  tensor([[ 0.2505, -0.3982, -0.9948,  0.3518, -1.3131],
          [ 0.3180, -0.6993,  1.0436,  0.0438,  0.2270],
          [-0.2751,  0.7303,  0.2192,  0.3321,  0.2488],
          [ 1.0778, -1.9510,  0.7048,  0.4742, -0.7125]])
  >>> torch.median(a, 1)
  torch.return_types.median(values=tensor([-0.3982,  0.2270,  0.2488,  0.4742]), indices=tensor([1, 4, 4, 3]))


ConstantPad1d
class torch.nn.ConstantPad1d(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 both boundaries. If a 2-tuple,
      uses (\text{padding_left}, \text{padding_right})
Shape:
      * Input: (C, W_{in}) or (N, C, W_{in}).
  * Output: (C, W_{out}) or (N, C, W_{out}), where

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

Examples:
  >>> m = nn.ConstantPad1d(2, 3.5)
  >>> input = torch.randn(1, 2, 4)
  >>> input
  tensor([[[-1.0491, -0.7152, -0.0749,  0.8530],
           [-1.3287,  1.8966,  0.1466, -0.2771]]])
  >>> m(input)
  tensor([[[ 3.5000,  3.5000, -1.0491, -0.7152, -0.0749,  0.8530,  3.5000,
             3.5000],


3.5000],
               [ 3.5000,  3.5000, -1.3287,  1.8966,  0.1466, -0.2771,  3.5000,
                 3.5000]]])
      >>> m = nn.ConstantPad1d(2, 3.5)
      >>> input = torch.randn(1, 2, 3)
      >>> input
      tensor([[[ 1.6616,  1.4523, -1.1255],
               [-3.6372,  0.1182, -1.8652]]])
      >>> m(input)
      tensor([[[ 3.5000,  3.5000,  1.6616,  1.4523, -1.1255,  3.5000,  3.5000],
               [ 3.5000,  3.5000, -3.6372,  0.1182, -1.8652,  3.5000,  3.5000]]])
      >>> # using different paddings for different sides
      >>> m = nn.ConstantPad1d((3, 1), 3.5)
      >>> m(input)
      tensor([[[ 3.5000,  3.5000,  3.5000,  1.6616,  1.4523, -1.1255,  3.5000],
               [ 3.5000,  3.5000,  3.5000, -3.6372,  0.1182, -1.8652,  3.5000]]])


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

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

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

Examples:
  >>> m = nn.ZeroPad2d(2)
  >>> input = torch.randn(1, 1, 3, 3)
  >>> input
  tensor([[[[-0.1678, -0.4418,  1.9466],
            [ 0.9604, -0.4219, -0.5241],
            [-0.9162, -0.5436, -0.6446]]]])
  >>> m(input)


m(input)
      tensor([[[[ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000],
                [ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000],
                [ 0.0000,  0.0000, -0.1678, -0.4418,  1.9466,  0.0000,  0.0000],
                [ 0.0000,  0.0000,  0.9604, -0.4219, -0.5241,  0.0000,  0.0000],
                [ 0.0000,  0.0000, -0.9162, -0.5436, -0.6446,  0.0000,  0.0000],
                [ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000],
                [ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000,  0.0000]]]])
      >>> # using different paddings for different sides
      >>> m = nn.ZeroPad2d((1, 1, 2, 0))
      >>> m(input)
      tensor([[[[ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000],
                [ 0.0000,  0.0000,  0.0000,  0.0000,  0.0000],
                [ 0.0000, -0.1678, -0.4418,  1.9466,  0.0000],
                [ 0.0000,  0.9604, -0.4219, -0.5241,  0.0000],
                [ 0.0000, -0.9162, -0.5436, -0.6446,  0.0000]]]])


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


torch.true_divide
torch.true_divide(dividend, divisor, *, out) -> Tensor
Alias for "torch.div()" with "rounding_mode=None".


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


torch.linalg.ldl_solve
torch.linalg.ldl_solve(LD, pivots, B, *, hermitian=False, out=None) -> Tensor
Computes the solution of a system of linear equations using the LDL
   factorization.
"LD" and "pivots" are the compact representation of the LDL
   factorization and are expected to be computed by
   "torch.linalg.ldl_factor_ex()". "hermitian" argument to this
   function should be the same as the corresponding arguments in
   "torch.linalg.ldl_factor_ex()".
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.
Warning:
 This function is "experimental" and it may change in a future
 PyTorch release.

Parameters:
      * LD (Tensor) -- the n times n matrix or the batch of
        such matrices of size (, n, n)* where *** is one or more
        batch dimensions.


batch dimensions.
  * **pivots** (*Tensor*) -- the pivots corresponding to the LDL
    factorization of "LD".

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

Keyword Arguments:
      * hermitian (bool, optional) -- whether to consider
        the decomposed matrix to be Hermitian or symmetric. For real-
        valued matrices, this switch has no effect. Default: False.
  * **out** (*tuple**, **optional*) -- output tensor. *B* may be
    passed as *out* and the result is computed in-place on *B*.
    Ignored if *None*. Default: *None*.

Examples:
  >>> A = torch.randn(2, 3, 3)
  >>> A = A @ A.mT # make symmetric
  >>> LD, pivots, info = torch.linalg.ldl_factor_ex(A)
  >>> B = torch.randn(2, 3, 4)
  >>> X = torch.linalg.ldl_solve(LD, pivots, B)
  >>> torch.linalg.norm(A @ X - B)
  >>> tensor(0.0001)


torch.tan
torch.tan(input, *, out=None) -> Tensor
Returns a new tensor with the tangent of the elements of "input".
  \text{out}_{i} = \tan(\text{input}_{i})

Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4)
  >>> a
  tensor([-1.2027, -1.7687,  0.4412, -1.3856])
  >>> torch.tan(a)
  tensor([-2.5930,  4.9859,  0.4722, -5.3366])


torch.Tensor.greater_equal_
Tensor.greater_equal_(other) -> Tensor
In-place version of "greater_equal()".


default_fused_per_channel_wt_fake_quant
torch.quantization.fake_quantize.default_fused_per_channel_wt_fake_quant
alias of functools.partial(, observer=,
   quant_min=-128, quant_max=127, dtype=torch.qint8,
   qscheme=torch.per_channel_symmetric){}


torch.optim.Optimizer.state_dict
Optimizer.state_dict()
Returns the state of the optimizer as a "dict".
It contains two entries:

state - a dict holding current optimization state. Its content
        differs between optimizer classes.

param_groups - a list containing all parameter groups where each
        parameter group is a dict


leaky_relu
class torch.ao.nn.quantized.functional.leaky_relu(input, negative_slope=0.01, inplace=False, scale=None, zero_point=None)
Quantized version of the. leaky_relu(input, negative_slope=0.01,
   inplace=False, scale, zero_point) -> Tensor
Applies element-wise, \text{LeakyReLU}(x) = \max(0, x) +
   \text{negative_slope} * \min(0, x)
Parameters:
      * input (Tensor) -- Quantized input
  * **negative_slope** (*float*) -- The slope of the negative
    input

  * **inplace** (*bool*) -- Inplace modification of the input
    tensor

  * **scale** (*Optional**[**float**]*) -- Scale and zero point of
    the output tensor.

  * **zero_point** (*Optional**[**int**]*) -- Scale and zero point
    of the output tensor.

See "LeakyReLU" for more details.


torch.func.jacfwd
torch.func.jacfwd(func, argnums=0, has_aux=False, *, randomness='error')
Computes the Jacobian of "func" with respect to the arg(s) at index
   "argnum" using forward-mode autodiff
Parameters:
      * func (function) -- A Python function that takes one or
        more arguments, one of which must be a Tensor, and returns one
        or more Tensors
  * **argnums** (*int** or **Tuple**[**int**]*) -- Optional,
    integer or tuple of integers, saying which arguments to get
    the Jacobian with respect to. Default: 0.

  * **has_aux** (*bool*) -- Flag indicating that "func" returns a
    "(output, aux)" tuple where the first element is the output of
    the function to be differentiated and the second element is
    auxiliary objects that will not be differentiated. Default:
    False.

  * **randomness** (*str*) -- Flag indicating what type of
    randomness to use. See "vmap()" for more detail. Allowed:


"different", "same", "error". Default: "error"
Returns:
      Returns a function that takes in the same inputs as "func" and
      returns the Jacobian of "func" with respect to the arg(s) at
      "argnums". If "has_aux is True", then the returned function
      instead returns a "(jacobian, aux)" tuple where "jacobian" is
      the Jacobian and "aux" is auxiliary objects returned by "func".
Note:
 You may see this API error out with "forward-mode AD not
 implemented for operator X". If so, please file a bug report and
 we will prioritize it. An alternative is to use "jacrev()", which
 has better operator coverage.

A basic usage with a pointwise, unary operation will give a
   diagonal array as the Jacobian

from torch.func import jacfwd
x = torch.randn(5)
jacobian = jacfwd(torch.sin)(x)
expected = torch.diag(torch.cos(x))
assert torch.allclose(jacobian, expected)

"jacfwd()" can be composed with vmap to produce batched Jacobians:


from torch.func import jacfwd, vmap
x = torch.randn(64, 5)
jacobian = vmap(jacfwd(torch.sin))(x)
assert jacobian.shape == (64, 5, 5)

If you would like to compute the output of the function as well as
   the jacobian of the function, use the "has_aux" flag to return the
   output as an auxiliary object:

from torch.func import jacfwd
x = torch.randn(5)
def f(x):
  return x.sin()
def g(x):
  result = f(x)
  return result, result
jacobian_f, f_x = jacfwd(g, has_aux=True)(x)
assert torch.allclose(f_x, f(x))

Additionally, "jacrev()" can be composed with itself or "jacrev()"
   to produce Hessians

from torch.func import jacfwd, jacrev
def f(x):
  return x.sin().sum()
x = torch.randn(5)
hessian = jacfwd(jacrev(f))(x)
assert torch.allclose(hessian, torch.diag(-x.sin()))

By default, "jacfwd()" computes the Jacobian with respect to the


first input. However, it can compute the Jacboian with respect to a
   different argument by using "argnums":

from torch.func import jacfwd
def f(x, y):
  return x + y ** 2
x, y = torch.randn(5), torch.randn(5)
jacobian = jacfwd(f, argnums=1)(x, y)
expected = torch.diag(2 * y)
assert torch.allclose(jacobian, expected)

Additionally, passing a tuple to "argnums" will compute the
   Jacobian with respect to multiple arguments

from torch.func import jacfwd
def f(x, y):
  return x + y ** 2
x, y = torch.randn(5), torch.randn(5)
jacobian = jacfwd(f, argnums=(0, 1))(x, y)
expectedX = torch.diag(torch.ones_like(x))
expectedY = torch.diag(2 * y)
assert torch.allclose(jacobian[0], expectedX)
assert torch.allclose(jacobian[1], expectedY)


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


torch.linalg.solve_ex
torch.linalg.solve_ex(A, B, *, left=True, check_errors=False, out=None)
A version of "solve()" that does not perform error checks unless
   "check_errors"= True. It also returns the "info" tensor returned
   by LAPACK's getrf.
Note:
 When the inputs are on a CUDA device, this function synchronizes
 only when "check_errors"*= True*.

Warning:
 This function is "experimental" and it may change in a future
 PyTorch release.

Parameters:
      A (Tensor) -- tensor of shape (, n, n)* where *** is
      zero or more batch dimensions.
Keyword Arguments:
      * left (bool, optional) -- whether to solve the system
        AX=B or XA = B. Default: True.
  * **check_errors** (*bool**, **optional*) -- controls whether to
    check the content of "infos" and raise an error if it is non-
    zero. Default: *False*.

  * **out** (*tuple**, **optional*) -- tuple of two tensors to


write the output to. Ignored if None. Default: None.
Returns:
      A named tuple (result, info).
Examples:
  >>> A = torch.randn(3, 3)
  >>> Ainv, info = torch.linalg.solve_ex(A)
  >>> torch.dist(torch.linalg.inv(A), Ainv)
  tensor(0.)
  >>> info
  tensor(0, dtype=torch.int32)


torch.nn.functional.smooth_l1_loss
torch.nn.functional.smooth_l1_loss(input, target, size_average=None, reduce=None, reduction='mean', beta=1.0)
Function that uses a squared term if the absolute element-wise
   error falls below beta and an L1 term otherwise.
See "SmoothL1Loss" for details.
Return type:
      Tensor


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

If "padding" is non-zero, then the input is implicitly padded with
   negative infinity on both sides for "padding" number of points.
   "dilation" controls the spacing between the kernel points. It is
   harder to describe, but this link has a nice visualization of what
   "dilation" does.
Note:


"dilation" does.
Note:
 When ceil_mode=True, sliding windows are allowed to go off-bounds
 if they start within the left padding or the input. Sliding
 windows that would start in the right padded region are ignored.

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

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

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

  * **padding** (*Union**[**int**, **Tuple**[**int**,
    **int**]**]*) -- Implicit negative infinity padding to be


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

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

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

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

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

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

Examples:


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


torch.jit.fork
torch.jit.fork(func, args, *kwargs)
Creates an asynchronous task executing func and a reference to
   the value of the result of this execution. fork will return
   immediately, so the return value of func may not have been
   computed yet. To force completion of the task and access the return
   value invoke torch.jit.wait on the Future. fork invoked with a
   func which returns T is typed as torch.jit.Future[T]. fork
   calls can be arbitrarily nested, and may be invoked with positional
   and keyword arguments. Asynchronous execution will only occur when
   run in TorchScript. If run in pure python, fork will not execute
   in parallel. fork will also not execute in parallel when invoked
   while tracing, however the fork and wait calls will be captured
   in the exported IR Graph.
Warning:
 *fork* tasks will execute non-deterministically. We recommend
 only spawning parallel fork tasks for pure functions that do not


modify their inputs, module attributes, or global state.
Parameters:
      * func (callable or torch.nn.Module) -- A Python
        function or torch.nn.Module that will be invoked. If
        executed in TorchScript, it will execute asynchronously,
        otherwise it will not. Traced invocations of fork will be
        captured in the IR.
  * ***args** -- arguments to invoke *func* with.

  * ****kwargs** -- arguments to invoke *func* with.

Returns:
      a reference to the execution of func. The value T can only
      be accessed by forcing completion of func through
      torch.jit.wait.
Return type:
      torch.jit.Future[T]
Example (fork a free function):
  import torch
  from torch import Tensor
  def foo(a : Tensor, b : int) -> Tensor:
      return a + b
  def bar(a):
      fut : torch.jit.Future[Tensor] = torch.jit.fork(foo, a, b=2)
      return torch.jit.wait(fut)
  script_bar = torch.jit.script(bar)


script_bar = torch.jit.script(bar)
      input = torch.tensor(2)
      # only the scripted version executes asynchronously
      assert script_bar(input) == bar(input)
      # trace is not run asynchronously, but fork is captured in IR
      graph = torch.jit.trace(bar, (input,)).graph
      assert "fork" in str(graph)
Example (fork a module method):
  import torch
  from torch import Tensor
  class AddMod(torch.nn.Module):
      def forward(self, a: Tensor, b : int):
          return a + b
  class Mod(torch.nn.Module):
      def __init__(self):
          super(self).__init__()
          self.mod = AddMod()
      def forward(self, input):
          fut = torch.jit.fork(self.mod, a, b=2)
          return torch.jit.wait(fut)
  input = torch.tensor(2)
  mod = Mod()
  assert mod(input) == torch.jit.script(mod).forward(input)


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


torch.nn.functional.logsigmoid
torch.nn.functional.logsigmoid(input) -> Tensor
Applies element-wise \text{LogSigmoid}(x_i) = \log \left(\frac{1}{1
   + \exp(-x_i)}\right)
See "LogSigmoid" for more details.


Parameter
class torch.nn.parameter.Parameter(data=None, requires_grad=True)
A kind of Tensor that is to be considered a module parameter.
Parameters are "Tensor" subclasses, that have a very special
   property when used with "Module" s - when they're assigned as
   Module attributes they are automatically added to the list of its
   parameters, and will appear e.g. in "parameters()" iterator.
   Assigning a Tensor doesn't have such effect. This is because one
   might want to cache some temporary state, like last hidden state of
   the RNN, in the model. If there was no such class as "Parameter",
   these temporaries would get registered too.
Parameters:
      * data (Tensor) -- parameter tensor.
  * **requires_grad** (*bool**, **optional*) -- if the parameter
    requires gradient. See Locally disabling gradient computation
    for more details. Default: *True*


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


torch.Tensor.q_zero_point
Tensor.q_zero_point() -> int
Given a Tensor quantized by linear(affine) quantization, returns
   the zero_point of the underlying quantizer().


torch.Tensor.dim
Tensor.dim() -> int
Returns the number of dimensions of "self" tensor.


PlaceholderObserver
class torch.quantization.observer.PlaceholderObserver(dtype=torch.float32, custom_op_name='', compute_dtype=None, quant_min=None, quant_max=None, is_dynamic=False)
Observer that doesn't do anything and just passes its configuration
   to the quantized module's ".from_float()".
Can be used for quantization to float16 which doesn't require
   determining ranges.
Parameters:
      * dtype -- dtype argument to the quantize node needed to
        implement the reference model spec.
  * **quant_min** -- minimum value in quantized domain (TODO:
    align behavior with other observers)

  * **quant_min** -- maximum value in quantized domain

  * **custom_op_name** -- (temporary) specify this observer for an
    operator that doesn't require any observation (Can be used in
    Graph Mode Passes for special case ops).

  * **compute_dtype** (*deprecated*) -- if set, marks the future


quantize function to use dynamic quantization instead of
        static quantization. This field is deprecated, use
        is_dynamic=True instead.
  * **is_dynamic** -- if True, the *quantize* function in the
    reference model representation taking stats from this observer
    instance will use dynamic quantization.


torch.Tensor.element_size
Tensor.element_size() -> int
Returns the size in bytes of an individual element.
Example:
  >>> torch.tensor([]).element_size()
  4
  >>> torch.tensor([], dtype=torch.uint8).element_size()
  1


torch.Tensor.sin_
Tensor.sin_() -> Tensor
In-place version of "sin()"


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


torch.nn.utils.parametrize.is_parametrized
torch.nn.utils.parametrize.is_parametrized(module, tensor_name=None)
Returns "True" if module has an active parametrization.
If the argument "tensor_name" is specified, returns "True" if
   "module[tensor_name]" is parametrized.
Parameters:
      * module (nn.Module) -- module to query
  * **tensor_name** (*str**, **optional*) -- attribute in the
    module to query Default: "None"

Return type:
      bool


torch.Tensor.scatter_reduce_
Tensor.scatter_reduce_(dim, index, src, reduce, *, include_self=True) -> Tensor
Reduces all values from the "src" tensor to the indices specified
   in the "index" tensor in the "self" tensor using the applied
   reduction defined via the "reduce" argument (""sum"", ""prod"",
   ""mean"", ""amax"", ""amin""). For each value in "src", it is
   reduced to an index in "self" which is specified by its index in
   "src" for "dimension != dim" and by the corresponding value in
   "index" for "dimension = dim". If "include_self="True"", the values
   in the "self" tensor are included in the reduction.
"self", "index" and "src" should all have the same number of
   dimensions. It is also required that "index.size(d) <= src.size(d)"
   for all dimensions "d", and that "index.size(d) <= self.size(d)"
   for all dimensions "d != dim". Note that "index" and "src" do not
   broadcast.
For a 3-D tensor with "reduce="sum"" and "include_self=True" the


output is given as:
  self[index[i][j][k]][j][k] += src[i][j][k]  # if dim == 0
  self[i][index[i][j][k]][k] += src[i][j][k]  # if dim == 1
  self[i][j][index[i][j][k]] += src[i][j][k]  # if dim == 2

Note:
 This operation may behave nondeterministically when given tensors
 on a CUDA device. See Reproducibility for more information.

Note:
 The backward pass is implemented only for "src.shape ==
 index.shape".

Warning:
 This function is in beta and may change in the near future.

Parameters:
      * dim (int) -- the axis along which to index
  * **index** (*LongTensor*) -- the indices of elements to scatter
    and reduce.

  * **src** (*Tensor*) -- the source elements to scatter and
    reduce

  * **reduce** (*str*) -- the reduction operation to apply for
    non-unique indices (""sum"", ""prod"", ""mean"", ""amax"",
    ""amin"")

  * **include_self** (*bool*) -- whether elements from the "self"


tensor are included in the reduction
Example:
  >>> src = torch.tensor([1., 2., 3., 4., 5., 6.])
  >>> index = torch.tensor([0, 1, 0, 1, 2, 1])
  >>> input = torch.tensor([1., 2., 3., 4.])
  >>> input.scatter_reduce(0, index, src, reduce="sum")
  tensor([5., 14., 8., 4.])
  >>> input.scatter_reduce(0, index, src, reduce="sum", include_self=False)
  tensor([4., 12., 5., 4.])
  >>> input2 = torch.tensor([5., 4., 3., 2.])
  >>> input2.scatter_reduce(0, index, src, reduce="amax")
  tensor([5., 6., 5., 2.])
  >>> input2.scatter_reduce(0, index, src, reduce="amax", include_self=False)
  tensor([3., 6., 5., 2.])


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


torch.negative
torch.negative(input, *, out=None) -> Tensor
Alias for "torch.neg()"


ReflectionPad3d
class torch.nn.ReflectionPad3d(padding)
Pads the input tensor using the reflection of the input boundary.
For N-dimensional padding, use "torch.nn.functional.pad()".
Parameters:
      padding (int, tuple) -- the size of the padding. If is
      int, uses the same padding in all boundaries. If a 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.ReflectionPad3d(1)


Examples:
  >>> m = nn.ReflectionPad3d(1)
  >>> input = torch.arange(8, dtype=torch.float).reshape(1, 1, 2, 2, 2)
  >>> m(input)
  tensor([[[[[7., 6., 7., 6.],
             [5., 4., 5., 4.],
             [7., 6., 7., 6.],
             [5., 4., 5., 4.]],
            [[3., 2., 3., 2.],
             [1., 0., 1., 0.],
             [3., 2., 3., 2.],
             [1., 0., 1., 0.]],
            [[7., 6., 7., 6.],
             [5., 4., 5., 4.],
             [7., 6., 7., 6.],
             [5., 4., 5., 4.]],
            [[3., 2., 3., 2.],
             [1., 0., 1., 0.],
             [3., 2., 3., 2.],
             [1., 0., 1., 0.]]]]])


torch.nn.functional.grid_sample
torch.nn.functional.grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corners=None)
Given an "input" and a flow-field "grid", computes the "output"
   using "input" values and pixel locations from "grid".
Currently, only spatial (4-D) and volumetric (5-D) "input" are
   supported.
In the spatial (4-D) case, for "input" with shape (N, C,
   H_\text{in}, W_\text{in}) and "grid" with shape (N, H_\text{out},
   W_\text{out}, 2), the output will have shape (N, C, H_\text{out},
   W_\text{out}).
For each output location "output[n, :, h, w]", the size-2 vector
   "grid[n, h, w]" specifies "input" pixel locations "x" and "y",
   which are used to interpolate the output value "output[n, :, h,
   w]". In the case of 5D inputs, "grid[n, d, h, w]" specifies the
   "x", "y", "z" pixel locations for interpolating "output[n, :, d, h,
   w]". "mode" argument specifies "nearest" or "bilinear"


interpolation method to sample the input pixels.
"grid" specifies the sampling pixel locations normalized by the
   "input" spatial dimensions. Therefore, it should have most values
   in the range of "[-1, 1]". For example, values "x = -1, y = -1" is
   the left-top pixel of "input", and values  "x = 1, y = 1" is the
   right-bottom pixel of "input".
If "grid" has values outside the range of "[-1, 1]", the
   corresponding outputs are handled as defined by "padding_mode".
   Options are
  * "padding_mode="zeros"": use "0" for out-of-bound grid
    locations,

  * "padding_mode="border"": use border values for out-of-bound
    grid locations,

  * "padding_mode="reflection"": use values at locations reflected
    by the border for out-of-bound grid locations. For location
    far away from the border, it will keep being reflected until
    becoming in bound, e.g., (normalized) pixel location "x =
    -3.5" reflects by border "-1" and becomes "x' = 1.5", then


reflects by border "1" and becomes "x'' = -0.5".
Note:
 This function is often used in conjunction with "affine_grid()"
 to build Spatial Transformer Networks .

Note:
 When using the CUDA backend, this operation may induce
 nondeterministic behaviour in its backward pass that is not
 easily switched off. Please see the notes on Reproducibility for
 background.

Note:
 NaN values in "grid" would be interpreted as "-1".

Parameters:
      * input (Tensor) -- input of shape (N, C, H_\text{in},
        W_\text{in}) (4-D case) or (N, C, D_\text{in}, H_\text{in},
        W_\text{in}) (5-D case)
  * **grid** (*Tensor*) -- flow-field of shape (N, H_\text{out},
    W_\text{out}, 2) (4-D case) or (N, D_\text{out}, H_\text{out},
    W_\text{out}, 3) (5-D case)

  * **mode** (*str*) -- interpolation mode to calculate output
    values "'bilinear'" | "'nearest'" | "'bicubic'". Default:


"'bilinear'" Note: "mode='bicubic'" supports only 4-D input.
        When "mode='bilinear'" and the input is 5-D, the interpolation
        mode used internally will actually be trilinear. However, when
        the input is 4-D, the interpolation mode will legitimately be
        bilinear.
  * **padding_mode** (*str*) -- padding mode for outside grid
    values "'zeros'" | "'border'" | "'reflection'". Default:
    "'zeros'"

  * **align_corners** (*bool**, **optional*) -- Geometrically, we
    consider the pixels of the input  as squares rather than
    points. If set to "True", the extrema ("-1" and "1") are
    considered as referring to the center points of the input's
    corner pixels. If set to "False", they are instead considered
    as referring to the corner points of the input's corner
    pixels, making the sampling more resolution agnostic. This
    option parallels the "align_corners" option in


"interpolate()", and so whichever option is used here should
        also be used there to resize the input image before grid
        sampling. Default: "False"
Returns:
      output Tensor
Return type:
      output (Tensor)
Warning:
 When "align_corners = True", the grid positions depend on the
 pixel size relative to the input image size, and so the locations
 sampled by "grid_sample()" will differ for the same input given
 at different resolutions (that is, after being upsampled or
 downsampled). The default behavior up to version 1.2.0 was
 "align_corners = True". Since then, the default behavior has been
 changed to "align_corners = False", in order to bring it in line
 with the default for "interpolate()".

Note:
 "mode='bicubic'" is implemented using the cubic convolution
 algorithm with \alpha=-0.75. The constant \alpha might be
 different from packages to packages. For example, PIL and OpenCV


use -0.5 and -0.75 respectively. This algorithm may "overshoot"
     the range of values it's interpolating. For example, it may
     produce negative values or values greater than 255 when
     interpolating input in [0, 255]. Clamp the results with :func:
     torch.clamp to ensure they are within the valid range.


torch.isin
torch.isin(elements, test_elements, *, assume_unique=False, invert=False) -> Tensor
Tests if each element of "elements" is in "test_elements". Returns
   a boolean tensor of the same shape as "elements" that is True for
   elements in "test_elements" and False otherwise.
Note:
 One of "elements" or "test_elements" can be a scalar, but not
 both.

Parameters:
      * elements (Tensor or Scalar) -- Input elements
  * **test_elements** (*Tensor** or **Scalar*) -- Values against
    which to test for each input element

  * **assume_unique** (*bool**, **optional*) -- If True, assumes
    both "elements" and "test_elements" contain unique elements,
    which can speed up the calculation. Default: False

  * **invert** (*bool**, **optional*) -- If True, inverts the
    boolean return tensor, resulting in True values for elements
    *not* in "test_elements". Default: False

Returns:


Returns:
      A boolean tensor of the same shape as "elements" that is True
      for elements in "test_elements" and False otherwise
-[ Example ]-

torch.isin(torch.tensor([[1, 2], [3, 4]]), torch.tensor([2, 3]))
   tensor([[False,  True],
           [ True, False]])


BackendPatternConfig
class torch.ao.quantization.backend_config.BackendPatternConfig(pattern=None)
Config object that specifies quantization behavior for a given
   operator pattern. For a detailed example usage, see
   "BackendConfig".
add_dtype_config(dtype_config)
  Add a set of supported data types passed as arguments to
  quantize ops in the reference model spec.

  Return type:
     *BackendPatternConfig*

classmethod from_dict(backend_pattern_config_dict)
  Create a "BackendPatternConfig" from a dictionary with the
  following items:

     "pattern": the pattern being configured "observation_type":
     the "ObservationType" that specifies how observers should be
     inserted for this pattern "dtype_configs": a list of
     dictionaries that represents "DTypeConfig" s "root_module": a
     "torch.nn.Module" that represents the root for this pattern
     "qat_module": a "torch.nn.Module" that represents the QAT


implementation for this pattern "reference_quantized_module":
         a "torch.nn.Module" that represents the reference quantized
         implementation for this pattern's root module.
         "fused_module": a "torch.nn.Module" that represents the fused
         implementation for this pattern "fuser_method": a function
         that specifies how to fuse the pattern for this pattern
         "pattern_complex_format": the pattern specified in the
         reversed nested tuple format (deprecated)
  Return type:
     *BackendPatternConfig*

set_dtype_configs(dtype_configs)
  Set the supported data types passed as arguments to quantize ops
  in the reference model spec, overriding all previously
  registered data types.

  Return type:
     *BackendPatternConfig*

set_fused_module(fused_module)
  Set the module that represents the fused implementation for this
  pattern.

  Return type:
     *BackendPatternConfig*


BackendPatternConfig
set_fuser_method(fuser_method)
  Set the function that specifies how to fuse this
  BackendPatternConfig's pattern.

  The first argument of this function should be *is_qat*, and the
  rest of the arguments should be the items in the tuple pattern.
  The return value of this function should be the resulting fused
  module.

  For example, the fuser method for the pattern *(torch.nn.Linear,
  torch.nn.ReLU)* can be:

     def fuse_linear_relu(is_qat, linear, relu):
        return torch.ao.nn.intrinsic.LinearReLU(linear, relu)

  For a more complicated example, see https://gist.github.com/jer
  ryzh168/8bea7180a8ba3c279f2c9b050f2a69a6.

  Return type:
     *BackendPatternConfig*

set_observation_type(observation_type)
  Set how observers should be inserted in the graph for this
  pattern.

  Observation type here refers to how observers (or quant-dequant


ops) will be placed in the graph. This is used to produce the
      desired reference patterns understood by the backend. Weighted
      ops such as linear and conv require different observers (or
      quantization parameters passed to quantize ops in the reference
      model) for the input and the output.
  There are two observation types:

     *OUTPUT_USE_DIFFERENT_OBSERVER_AS_INPUT* (default): the
     output observer instance will be different from the input.
     This is the most common observation type.

     *OUTPUT_SHARE_OBSERVER_WITH_INPUT*: the output observer
     instance will be the same as the input. This is useful for
     operators like *cat*.

  Note: This will be renamed in the near future, since we will
  soon insert QuantDeQuantStubs with observers (and fake
  quantizes) attached instead of observers themselves.

  Return type:
     *BackendPatternConfig*

set_pattern(pattern)
  Set the pattern to configure.


Set the pattern to configure.
  The pattern can be a float module, functional operator, pytorch
  operator, or a tuple combination of the above. Tuple patterns
  are treated as sequential patterns, and currently only tuples of
  2 or 3 elements are supported.

  Return type:
     *BackendPatternConfig*

set_qat_module(qat_module)
  Set the module that represents the QAT implementation for this
  pattern.

  Return type:
     *BackendPatternConfig*

set_reference_quantized_module(reference_quantized_module)
  Set the module that represents the reference quantized
  implementation for this pattern's root module.

  For more detail, see "set_root_module()".

  Return type:
     *BackendPatternConfig*

set_root_module(root_module)
  Set the module that represents the root for this pattern.

  When we construct the reference quantized model during the
  convert phase, the root modules (e.g. torch.nn.Linear for


torch.ao.nn.intrinsic.LinearReLU) will be swapped to the
      corresponding reference quantized modules (e.g.
      torch.ao.nn.reference.quantized.Linear). This allows custom
      backends to specify custom reference quantized module
      implementations to match the numerics of their lowered
      operators. Since this is a one-to-one mapping, both the root
      module and the reference quantized module must be specified in
      the same BackendPatternConfig in order for the conversion to
      take place.
  Return type:
     *BackendPatternConfig*

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

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