torch.sinh
torch.sinh(input, *, out=None) -> Tensor
Returns a new tensor with the hyperbolic sine of the elements of
   "input".
  \text{out}_{i} = \sinh(\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.5380, -0.8632, -0.1265,  0.9399])
  >>> torch.sinh(a)
  tensor([ 0.5644, -0.9744, -0.1268,  1.0845])

Note:
 When "input" is on the CPU, the implementation of torch.sinh may
 use the Sleef library, which rounds very large results to
 infinity or negative infinity. See here for details.


inference_mode
class torch.inference_mode(mode=True)
Context-manager that enables or disables inference mode
InferenceMode is a new context manager analogous to "no_grad" to be
   used when you are certain your operations will have no interactions
   with autograd (e.g., model training). Code run under this mode gets
   better performance by disabling view tracking and version counter
   bumps. Note that unlike some other mechanisms that locally enable
   or disable grad, entering inference_mode also disables to forward-
   mode AD.
This context manager is thread local; it will not affect
   computation in other threads.
Also functions as a decorator. (Make sure to instantiate with
   parenthesis.)
Note:
 Inference mode is one of several mechanisms that can enable or
 disable gradients locally see Locally disabling gradient
 computation for more information on how they compare.

Parameters:


Parameters:
      mode (bool) -- Flag whether to enable or disable inference
      mode
Example::
      >>> import torch
      >>> x = torch.ones(1, 2, 3, requires_grad=True)
      >>> with torch.inference_mode():
      ...     y = x * x
      >>> y.requires_grad
      False
      >>> y._version
      Traceback (most recent call last):
      File "", line 1, in
      RuntimeError: Inference tensors do not track version counter.
      >>> @torch.inference_mode()
      ... def func(x):
      ...     return x * x
      >>> out = func(x)
      >>> out.requires_grad
      False


torch.Tensor.arccos_
Tensor.arccos_() -> Tensor
In-place version of "arccos()"


torch.Tensor.addmv
Tensor.addmv(mat, vec, *, beta=1, alpha=1) -> Tensor
See "torch.addmv()"


torch.Tensor.less_
Tensor.less_(other) -> Tensor
In-place version of "less()".


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


convert
class torch.quantization.convert(module, mapping=None, inplace=False, remove_qconfig=True, is_reference=False, convert_custom_config_dict=None)
Converts submodules in input module to a different module according
   to mapping by calling from_float method on the target module
   class. And remove qconfig at the end if remove_qconfig is set to
   True.
Parameters:
      * module -- prepared and calibrated module
  * **mapping** -- a dictionary that maps from source module type
    to target module type, can be overwritten to allow swapping
    user defined Modules

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

  * **convert_custom_config_dict** -- custom configuration
    dictionary for convert function

  # Example of convert_custom_config_dict:
  convert_custom_config_dict = {
      # user will manually define the corresponding quantized


module class which has a from_observed class method that converts
      # observed custom module to quantized custom module
      "observed_to_quantized_custom_module_class": {
          ObservedCustomModule: QuantizedCustomModule
      }
  }


torch.Tensor.divide_
Tensor.divide_(value, *, rounding_mode=None) -> Tensor
In-place version of "divide()"


graph
class torch.cuda.graph(cuda_graph, pool=None, stream=None)
Context-manager that captures CUDA work into a
   "torch.cuda.CUDAGraph" object for later replay.
See CUDA Graphs for a general introduction, detailed use, and
   constraints.
Parameters:
      * cuda_graph (torch.cuda.CUDAGraph) -- Graph object used
        for capture.
  * **pool** (*optional*) -- Opaque token (returned by a call to
    "graph_pool_handle()" or "other_Graph_instance.pool()")
    hinting this graph's capture may share memory from the
    specified pool. See Graph memory management.

  * **stream** (*torch.cuda.Stream**, **optional*) -- If supplied,
    will be set as the current stream in the context. If not
    supplied, "graph" sets its own internal side stream as the
    current stream in the context.

Note:
 For effective memory sharing, if you pass a "pool" used by a
 previous capture and the previous capture used an explicit


"stream" argument, you should pass the same "stream" argument to
     this capture.
Warning:
 This API is in beta and may change in future releases.


torch.jit.load
torch.jit.load(f, map_location=None, _extra_files=None)
Load a "ScriptModule" or "ScriptFunction" previously saved with
   "torch.jit.save"
All previously saved modules, no matter their device, are first
   loaded onto CPU, and then are moved to the devices they were saved
   from. If this fails (e.g. because the run time system doesn't have
   certain devices), an exception is raised.
Parameters:
      * f -- a file-like object (has to implement read, readline,
        tell, and seek), or a string containing a file name
  * **map_location** (*string** or **torch.device*) -- A
    simplified version of "map_location" in *torch.jit.save* used
    to dynamically remap storages to an alternative set of
    devices.

  * **_extra_files** (*dictionary of filename to content*) -- The
    extra filenames given in the map would be loaded and their
    content would be stored in the provided map.

Returns:
      A "ScriptModule" object.


Returns:
      A "ScriptModule" object.
Example:
  import torch
  import io

  torch.jit.load('scriptmodule.pt')

  # Load ScriptModule from io.BytesIO object
  with open('scriptmodule.pt', 'rb') as f:
      buffer = io.BytesIO(f.read())

  # Load all tensors to the original device
  torch.jit.load(buffer)

  # Load all tensors onto CPU, using a device
  buffer.seek(0)
  torch.jit.load(buffer, map_location=torch.device('cpu'))

  # Load all tensors onto CPU, using a string
  buffer.seek(0)
  torch.jit.load(buffer, map_location='cpu')

  # Load with extra files.
  extra_files = {'foo.txt': ''}  # values will be replaced with data
  torch.jit.load('scriptmodule.pt', _extra_files=extra_files)
  print(extra_files['foo.txt'])


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


torch.complex
torch.complex(real, imag, *, out=None) -> Tensor
Constructs a complex tensor with its real part equal to "real" and
   its imaginary part equal to "imag".
Parameters:
      * real (Tensor) -- The real part of the complex tensor.
        Must be float or double.
  * **imag** (*Tensor*) -- The imaginary part of the complex
    tensor. Must be same dtype as "real".

Keyword Arguments:
      out (Tensor) -- If the inputs are "torch.float32", must be
      "torch.complex64". If the inputs are "torch.float64", must be
      "torch.complex128".
Example:
  >>> real = torch.tensor([1, 2], dtype=torch.float32)
  >>> imag = torch.tensor([3, 4], dtype=torch.float32)
  >>> z = torch.complex(real, imag)
  >>> z
  tensor([(1.+3.j), (2.+4.j)])
  >>> z.dtype
  torch.complex64


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


torch.lcm
torch.lcm(input, other, *, out=None) -> Tensor
Computes the element-wise least common multiple (LCM) of "input"
   and "other".
Both "input" and "other" must have integer types.
Note:
 This defines lcm(0, 0) = 0 and lcm(0, a) = 0.

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

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.tensor([5, 10, 15])
  >>> b = torch.tensor([3, 4, 5])
  >>> torch.lcm(a, b)
  tensor([15, 20, 15])
  >>> c = torch.tensor([3])
  >>> torch.lcm(a, c)
  tensor([15, 30, 15])


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


torch.isposinf
torch.isposinf(input, *, out=None) -> Tensor
Tests if each element of "input" is positive infinity or not.
Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.tensor([-float('inf'), float('inf'), 1.2])
  >>> torch.isposinf(a)
  tensor([False,  True, False])


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


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


RNN
class torch.nn.RNN(args, *kwargs)
Applies a multi-layer Elman RNN with \tanh or \text{ReLU} non-
   linearity to an input sequence.
For each element in the input sequence, each layer computes the
   following function:
  h_t = \tanh(x_t W_{ih}^T + b_{ih} + h_{t-1}W_{hh}^T + b_{hh})

where h_t is the hidden state at time t, x_t is the input at time
   t, and h_{(t-1)} is the hidden state of the previous layer at
   time t-1 or the initial hidden state at time 0. If
   "nonlinearity" is "'relu'", then \text{ReLU} is used instead of
   \tanh.
Parameters:
      * input_size -- The number of expected features in the input
        x
  * **hidden_size** -- The number of features in the hidden state
    *h*

  * **num_layers** -- Number of recurrent layers. E.g., setting
    "num_layers=2" would mean stacking two RNNs together to form a
    *stacked RNN*, with the second RNN taking in outputs of the


first RNN and computing the final results. Default: 1
  * **nonlinearity** -- The non-linearity to use. Can be either
    "'tanh'" or "'relu'". Default: "'tanh'"

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

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

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

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

Inputs: input, h_0
      * input: tensor of shape (L, H_{in}) for unbatched input,


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

  where:

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

Outputs: output, h_n
      * output: tensor of shape (L, D * H_{out}) for unbatched


input, (L, N, D * H_{out}) when "batch_first=False" or (N, L,
        D * H_{out}) when "batch_first=True" containing the output
        features (h_t) from the last layer of the RNN, for each t.
        If a "torch.nn.utils.rnn.PackedSequence" has been given as the
        input, the output will also be a packed sequence.
  * **h_n**: tensor of shape (D * \text{num\_layers}, H_{out}) for
    unbatched input or (D * \text{num\_layers}, N, H_{out})
    containing the final hidden state for each element in the
    batch.

Variables:
      * weight_ih_l[k] -- the learnable input-hidden weights of
        the k-th layer, of shape (hidden_size, input_size) for k =
        0. Otherwise, the shape is (hidden_size, num_directions *
        hidden_size)
  * **weight_hh_l[k]** -- the learnable hidden-hidden weights of
    the k-th layer, of shape *(hidden_size, hidden_size)*

  * **bias_ih_l[k]** -- the learnable input-hidden bias of the


k-th layer, of shape (hidden_size)
  * **bias_hh_l[k]** -- the learnable hidden-hidden bias of the
    k-th layer, of shape *(hidden_size)*

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

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

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

Warning:
 There are known non-determinism issues for RNN functions on some
 versions of cuDNN and CUDA. You can enforce deterministic
 behavior by setting the following environment variables:On CUDA
 10.1, set environment variable "CUDA_LAUNCH_BLOCKING=1". This may
 affect performance.On CUDA 10.2 or later, set environment
 variable (note the leading colon symbol)


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

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


torch.Tensor.tanh_
Tensor.tanh_() -> Tensor
In-place version of "tanh()"


torch.deg2rad
torch.deg2rad(input, *, out=None) -> Tensor
Returns a new tensor with each of the elements of "input" converted
   from angles in degrees to radians.
Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.tensor([[180.0, -180.0], [360.0, -360.0], [90.0, -90.0]])
  >>> torch.deg2rad(a)
  tensor([[ 3.1416, -3.1416],
          [ 6.2832, -6.2832],
          [ 1.5708, -1.5708]])


torch.rand
torch.rand(size, , generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False) -> Tensor
Returns a tensor filled with random numbers from a uniform
   distribution on the interval [0, 1)
The shape of the tensor is defined by the variable argument "size".
Parameters:
      size (int...) -- a sequence of integers defining the
      shape of the output tensor. Can be a variable number of
      arguments or a collection like a list or tuple.
Keyword Arguments:
      * generator ("torch.Generator", optional) -- a pseudorandom
        number generator for sampling
  * **out** (*Tensor**, **optional*) -- the output tensor.

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

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


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

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

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

Example:
  >>> torch.rand(4)
  tensor([ 0.5204,  0.2503,  0.3525,  0.5673])
  >>> torch.rand(2, 3)
  tensor([[ 0.8237,  0.5781,  0.6879],
          [ 0.3816,  0.7249,  0.0998]])


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


torch.autograd.profiler.load_nvprof
torch.autograd.profiler.load_nvprof(path)
Opens an nvprof trace file and parses autograd annotations.
Parameters:
      path (str) -- path to nvprof trace


torch.Tensor.triu
Tensor.triu(diagonal=0) -> Tensor
See "torch.triu()"


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


check_sparse_tensor_invariants
class torch.sparse.check_sparse_tensor_invariants(enable=True)
A tool to control checking sparse tensor invariants.
The following options exists to manage sparsr tensor invariants
   checking in sparse tensor construction:

Using a context manager:
 with torch.sparse.check_sparse_tensor_invariants():
     run_my_model()

Using a procedural approach:
 prev_checks_enabled = torch.sparse.check_sparse_tensor_invariants.is_enabled()
 torch.sparse.check_sparse_tensor_invariants.enable()

 run_my_model()

 if not prev_checks_enabled:
     torch.sparse.check_sparse_tensor_invariants.disable()

Using function decoration:
 @torch.sparse.check_sparse_tensor_invariants()
 def run_my_model():
     ...

 run_my_model()

Using "check_invariants" keyword argument in sparse tensor
      constructor call. For example:


constructor call. For example:
  >>> torch.sparse_csr_tensor([0, 1, 3], [0, 1], [1, 2], check_invariants=True)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  RuntimeError: `crow_indices[..., -1] == nnz` is not satisfied.

static disable()
  Disable sparse tensor invariants checking in sparse tensor
  constructors.

  See "torch.sparse.check_sparse_tensor_invariants.enable()" for
  more information.

static enable()
  Enable sparse tensor invariants checking in sparse tensor
  constructors.

  Note:

    By default, the sparse tensor invariants checks are disabled.
    Use "torch.sparse.check_sparse_tensor_invariants.is_enabled()"
    to retrieve the current state of sparse tensor invariants
    checking.

  Note:

    The sparse tensor invariants check flag is effective to all
    sparse tensor constructors, both in Python and ATen.The flag


can be locally overridden by the "check_invariants" optional
        argument of the sparse tensor constructor functions.
static is_enabled()
  Returns True if the sparse tensor invariants checking is
  enabled.

  Note:

    Use "torch.sparse.check_sparse_tensor_invariants.enable()" or
    "torch.sparse.check_sparse_tensor_invariants.disable()" to
    manage the state of the sparse tensor invariants checks.


torch.sin
torch.sin(input, *, out=None) -> Tensor
Returns a new tensor with the sine of the elements of "input".
  \text{out}_{i} = \sin(\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.5461,  0.1347, -2.7266, -0.2746])
  >>> torch.sin(a)
  tensor([-0.5194,  0.1343, -0.4032, -0.2711])


torch.autograd.graph.Node.register_prehook
abstract Node.register_prehook(fn)
Registers a backward pre-hook.
The hook will be called every time a gradient with respect to the
   Node is computed. The hook should have the following signature:
  hook(grad_outputs: Tuple[Tensor]) -> Tuple[Tensor] or None

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

Example:
  >>> a = torch.tensor([0., 0., 0.], requires_grad=True)
  >>> b = a.clone()
  >>> assert isinstance(b.grad_fn, torch.autograd.graph.Node)
  >>> handle = b.grad_fn.register_prehook(lambda gI: (gI[0] * 2,))


b.sum().backward(retain_graph=True)
      >>> print(a.grad)
      tensor([2., 2., 2.])
      >>> handle.remove()
      >>> a.grad = None
      >>> b.sum().backward(retain_graph=True)
      >>> print(a.grad)
      tensor([1., 1., 1.])

Return type:
      RemovableHandle


torch.nn.utils.rnn.pack_padded_sequence
torch.nn.utils.rnn.pack_padded_sequence(input, lengths, batch_first=False, enforce_sorted=True)
Packs a Tensor containing padded sequences of variable length.
"input" can be of size "T x B x " where T is the length of the
   longest sequence (equal to "lengths[0]"), "B" is the batch size,
   and "" is any number of dimensions (including 0). If "batch_first"
   is "True", "B x T x *" "input" is expected.
For unsorted sequences, use enforce_sorted = False. If
   "enforce_sorted" is "True", the sequences should be sorted by
   length in a decreasing order, i.e. "input[:,0]" should be the
   longest sequence, and "input[:,B-1]" the shortest one.
   enforce_sorted = True is only necessary for ONNX export.
Note:
 This function accepts any input that has at least two dimensions.
 You can apply it to pack the labels, and use the output of the


RNN with them to compute the loss directly. A Tensor can be
     retrieved from a "PackedSequence" object by accessing its ".data"
     attribute.
Parameters:
      * input (Tensor) -- padded batch of variable length
        sequences.
  * **lengths** (*Tensor** or **list**(**int**)*) -- list of
    sequence lengths of each batch element (must be on the CPU if
    provided as a tensor).

  * **batch_first** (*bool**, **optional*) -- if "True", the input
    is expected in "B x T x *" format.

  * **enforce_sorted** (*bool**, **optional*) -- if "True", the
    input is expected to contain sequences sorted by length in a
    decreasing order. If "False", the input will get sorted
    unconditionally. Default: "True".

Returns:
      a "PackedSequence" object
Return type:
      PackedSequence


torch.nn.utils.clip_grad_value_
torch.nn.utils.clip_grad_value_(parameters, clip_value, foreach=None)
Clips gradient of an iterable of parameters at specified value.
Gradients are modified in-place.
Parameters:
      * parameters (Iterable[Tensor] or Tensor) -- an
        iterable of Tensors or a single Tensor that will have
        gradients normalized
  * **clip_value** (*float*) -- maximum allowed value of the
    gradients. The gradients are clipped in the range
    \left[\text{-clip\_value}, \text{clip\_value}\right]

  * **foreach** (*bool*) -- use the faster foreach-based
    implementation If "None", use the foreach implementation for
    CUDA and CPU tensors and silently fall back to the slow
    implementation for other device types. Default: "None"


torch.Tensor.igammac_
Tensor.igammac_(other) -> Tensor
In-place version of "igammac()"


torch.autograd.functional.hessian
torch.autograd.functional.hessian(func, inputs, create_graph=False, strict=False, vectorize=False, outer_jacobian_strategy='reverse-mode')
Function that computes the Hessian of a given scalar function.
Parameters:
      * func (function) -- a Python function that takes Tensor
        inputs and returns a Tensor with a single element.
  * **inputs** (*tuple of Tensors** or **Tensor*) -- inputs to the
    function "func".

  * **create_graph** (*bool**, **optional*) -- If "True", the
    Hessian will be computed in a differentiable manner. Note that
    when "strict" is "False", the result can not require gradients
    or be disconnected from the inputs. Defaults to "False".

  * **strict** (*bool**, **optional*) -- If "True", an error will
    be raised when we detect that there exists an input such that
    all the outputs are independent of it. If "False", we return a


Tensor of zeros as the hessian for said inputs, which is the
        expected mathematical value. Defaults to "False".
  * **vectorize** (*bool**, **optional*) -- This feature is
    experimental. Please consider using "torch.func.hessian()"
    instead if you are looking for something less experimental and
    more performant. When computing the hessian, usually we invoke
    "autograd.grad" once per row of the hessian. If this flag is
    "True", we use the vmap prototype feature as the backend to
    vectorize calls to "autograd.grad" so we only invoke it once
    instead of once per row. This should lead to performance
    improvements in many use cases, however, due to this feature
    being incomplete, there may be performance cliffs. Please use
    *torch._C._debug_only_display_vmap_fallback_warnings(True)* to
    show any performance warnings and file us issues if warnings
    exist for your use case. Defaults to "False".


outer_jacobian_strategy (str, optional) -- The
        Hessian is computed by computing the Jacobian of a Jacobian.
        The inner Jacobian is always computed in reverse-mode AD.
        Setting strategy to ""forward-mode"" or ""reverse-mode""
        determines whether the outer Jacobian will be computed with
        forward or reverse mode AD. Currently, computing the outer
        Jacobian in ""forward-mode"" requires "vectorized=True".
        Defaults to ""reverse-mode"".

Returns:
      if there is a single input, this will be a single Tensor
      containing the Hessian for the input. If it is a tuple, then the
      Hessian will be a tuple of tuples where "Hessian[i][j]" will
      contain the Hessian of the "i"th input and "j"th input with size
      the sum of the size of the "i"th input plus the size of the
      "j"th input. "Hessian[i][j]" will have the same dtype and device
      as the corresponding "i"th input.
Return type:


Return type:
      Hessian (Tensor or a tuple of tuple of Tensors)
-[ Example ]-

def pow_reducer(x):
   ...     return x.pow(3).sum()
inputs = torch.rand(2, 2)
hessian(pow_reducer, inputs)
   tensor([[[[5.2265, 0.0000],
             [0.0000, 0.0000]],
            [[0.0000, 4.8221],
             [0.0000, 0.0000]]],
           [[[0.0000, 0.0000],
             [1.9456, 0.0000]],
            [[0.0000, 0.0000],
             [0.0000, 3.2550]]]])
hessian(pow_reducer, inputs, create_graph=True)
   tensor([[[[5.2265, 0.0000],
             [0.0000, 0.0000]],
            [[0.0000, 4.8221],
             [0.0000, 0.0000]]],
           [[[0.0000, 0.0000],
             [1.9456, 0.0000]],
            [[0.0000, 0.0000],
             [0.0000, 3.2550]]]], grad_fn=)
def pow_adder_reducer(x, y):
   ...     return (2 * x.pow(2) + 3 * y.pow(2)).sum()
inputs = (torch.rand(2), torch.rand(2))
hessian(pow_adder_reducer, inputs)
   ((tensor([[4., 0.],


((tensor([[4., 0.],
             [0., 4.]]),
     tensor([[0., 0.],
             [0., 0.]])),
    (tensor([[0., 0.],
             [0., 0.]]),
     tensor([[6., 0.],
             [0., 6.]])))


torch.hstack
torch.hstack(tensors, *, out=None) -> Tensor
Stack tensors in sequence horizontally (column wise).
This is equivalent to concatenation along the first axis for 1-D
   tensors, and along the second axis for all other tensors.
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.hstack((a,b))
  tensor([1, 2, 3, 4, 5, 6])
  >>> a = torch.tensor([[1],[2],[3]])
  >>> b = torch.tensor([[4],[5],[6]])
  >>> torch.hstack((a,b))
  tensor([[1, 4],
          [2, 5],
          [3, 6]])


torch.vmap
torch.vmap(func, in_dims=0, out_dims=0, randomness='error', *, chunk_size=None)
vmap is the vectorizing map; "vmap(func)" returns a new function
   that maps "func" over some dimension of the inputs. Semantically,
   vmap pushes the map into PyTorch operations called by "func",
   effectively vectorizing those operations.
vmap is useful for handling batch dimensions: one can write a
   function "func" that runs on examples and then lift it to a
   function that can take batches of examples with "vmap(func)". vmap
   can also be used to compute batched gradients when composed with
   autograd.
Note:
 "torch.vmap()" is aliased to "torch.func.vmap()" for convenience.
 Use whichever one you'd like.

Parameters:
      * func (function) -- A Python function that takes one or
        more arguments. Must return one or more Tensors.
  * **in_dims** (*int** or **nested structure*) -- Specifies which


dimension of the inputs should be mapped over. "in_dims"
        should have a structure like the inputs. If the "in_dim" for a
        particular input is None, then that indicates there is no map
        dimension. Default: 0.
  * **out_dims** (*int** or **Tuple**[**int**]*) -- Specifies
    where the mapped dimension should appear in the outputs. If
    "out_dims" is a Tuple, then it should have one element per
    output. Default: 0.

  * **randomness** (*str*) -- Specifies whether the randomness in
    this vmap should be the same or different across batches. If
    'different', the randomness for each batch will be different.
    If 'same', the randomness will be the same across batches. If
    'error', any calls to random functions will error. Default:
    'error'. WARNING: this flag only applies to random PyTorch
    operations and does not apply to Python's random module or
    numpy randomness.


numpy randomness.
  * **chunk_size** (*None** or **int*) -- If None (default), apply
    a single vmap over inputs. If not None, then compute the vmap
    "chunk_size" samples at a time. Note that "chunk_size=1" is
    equivalent to computing the vmap with a for-loop. If you run
    into memory issues computing the vmap, please try a non-None
    chunk_size.

Returns:
      Returns a new "batched" function. It takes the same inputs as
      "func", except each input has an extra dimension at the index
      specified by "in_dims". It takes returns the same outputs as
      "func", except each output has an extra dimension at the index
      specified by "out_dims".
Return type:
      Callable
One example of using "vmap()" is to compute batched dot products.
   PyTorch doesn't provide a batched "torch.dot" API; instead of
   unsuccessfully rummaging through docs, use "vmap()" to construct a
   new function.


new function.

torch.dot                            # [D], [D] -> []
batched_dot = torch.func.vmap(torch.dot)  # [N, D], [N, D] -> [N]
x, y = torch.randn(2, 5), torch.randn(2, 5)
batched_dot(x, y)

"vmap()" can be helpful in hiding batch dimensions, leading to a
   simpler model authoring experience.

batch_size, feature_size = 3, 5
weights = torch.randn(feature_size, requires_grad=True)
def model(feature_vec):
    # Very simple linear model with activation
    return feature_vec.dot(weights).relu()
examples = torch.randn(batch_size, feature_size)
result = torch.vmap(model)(examples)

"vmap()" can also help vectorize computations that were previously
   difficult or impossible to batch. One example is higher-order
   gradient computation. The PyTorch autograd engine computes vjps
   (vector-Jacobian products). Computing a full Jacobian matrix for
   some function f: R^N -> R^N usually requires N calls to


"autograd.grad", one per Jacobian row. Using "vmap()", we can
   vectorize the whole computation, computing the Jacobian in a single
   call to "autograd.grad".

Setup
N = 5
f = lambda x: x ** 2
x = torch.randn(N, requires_grad=True)
y = f(x)
I_N = torch.eye(N)
Sequential approach
jacobian_rows = [torch.autograd.grad(y, x, v, retain_graph=True)[0]
                 for v in I_N.unbind()]
jacobian = torch.stack(jacobian_rows)
vectorized gradient computation
def get_vjp(v):
    return torch.autograd.grad(y, x, v)
jacobian = torch.vmap(get_vjp)(I_N)

"vmap()" can also be nested, producing an output with multiple
   batched dimensions

torch.dot                            # [D], [D] -> []
batched_dot = torch.vmap(torch.vmap(torch.dot))  # [N1, N0, D], [N1, N0, D] -> [N1, N0]
x, y = torch.randn(2, 3, 5), torch.randn(2, 3, 5)
batched_dot(x, y) # tensor of size [2, 3]


batched_dot(x, y) # tensor of size [2, 3]

If the inputs are not batched along the first dimension, "in_dims"
   specifies the dimension that each inputs are batched along as

torch.dot                            # [N], [N] -> []
batched_dot = torch.vmap(torch.dot, in_dims=1)  # [N, D], [N, D] -> [D]
x, y = torch.randn(2, 5), torch.randn(2, 5)
batched_dot(x, y)   # output is [5] instead of [2] if batched along the 0th dimension

If there are multiple inputs each of which is batched along
   different dimensions, "in_dims" must be a tuple with the batch
   dimension for each input as

torch.dot                            # [D], [D] -> []
batched_dot = torch.vmap(torch.dot, in_dims=(0, None))  # [N, D], [D] -> [N]
x, y = torch.randn(2, 5), torch.randn(5)
batched_dot(x, y) # second arg doesn't have a batch dim because in_dim[1] was None

If the input is a Python struct, "in_dims" must be a tuple


containing a struct matching the shape of the input:

f = lambda dict: torch.dot(dict['x'], dict['y'])
x, y = torch.randn(2, 5), torch.randn(5)
input = {'x': x, 'y': y}
batched_dot = torch.vmap(f, in_dims=({'x': 0, 'y': None},))
batched_dot(input)

By default, the output is batched along the first dimension.
   However, it can be batched along any dimension by using "out_dims"

f = lambda x: x ** 2
x = torch.randn(2, 5)
batched_pow = torch.vmap(f, out_dims=1)
batched_pow(x) # [5, 2]

For any function that uses kwargs, the returned function will not
   batch the kwargs but will accept kwargs

x = torch.randn([2, 5])
def fn(x, scale=4.):
  return x * scale
batched_pow = torch.vmap(fn)
assert torch.allclose(batched_pow(x), x * 4)
batched_pow(x, scale=x) # scale is not batched, output has shape [2, 2, 5]

Note:
 vmap does not provide general autobatching or handle variable-


length sequences out of the box.


torch.cuda.default_stream
torch.cuda.default_stream(device=None)
Returns the default "Stream" for a given device.
Parameters:
      device (torch.device or int, optional) -- selected
      device. Returns the default "Stream" for the current device,
      given by "current_device()", if "device" is "None" (default).
Return type:
      Stream


torch.Tensor.numpy
Tensor.numpy(*, force=False) -> numpy.ndarray
Returns the tensor as a NumPy "ndarray".
If "force" is "False" (the default), the conversion is performed
   only if the tensor is on the CPU, does not require grad, does not
   have its conjugate bit set, and is a dtype and layout that NumPy
   supports. The returned ndarray and the tensor will share their
   storage, so changes to the tensor will be reflected in the ndarray
   and vice versa.
If "force" is "True" this is equivalent to calling
   "t.detach().cpu().resolve_conj().resolve_neg().numpy()". If the
   tensor isn't on the CPU or the conjugate or negative bit is set,
   the tensor won't share its storage with the returned ndarray.
   Setting "force" to "True" can be a useful shorthand.
Parameters:
      force (bool) -- if "True", the ndarray may be a copy of
      the tensor instead of always sharing memory, defaults to
      "False".


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


torch.nn.functional.pdist
torch.nn.functional.pdist(input, p=2) -> Tensor
Computes the p-norm distance between every pair of row vectors in
   the input. This is identical to the upper triangular portion,
   excluding the diagonal, of torch.norm(input[:, None] - input,
   dim=2, p=p). This function will be faster if the rows are
   contiguous.
If input has shape N \times M then the output will have shape
   \frac{1}{2} N (N - 1).
This function is equivalent to "scipy.spatial.distance.pdist(input,
   'minkowski', p=p)" if p \in (0, \infty). When p = 0 it is
   equivalent to "scipy.spatial.distance.pdist(input, 'hamming') * M".
   When p = \infty, the closest scipy function is
   "scipy.spatial.distance.pdist(xn, lambda x, y: np.abs(x -
   y).max())".
Parameters:
      * input -- input tensor of shape N \times M.
  * **p** -- p value for the p-norm distance to calculate between
    each vector pair \in [0, \infty].


LogSigmoid
class torch.nn.LogSigmoid
Applies the element-wise function:
  \text{LogSigmoid}(x) = \log\left(\frac{ 1 }{ 1 +
  \exp(-x)}\right)

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

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


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


SELU
class torch.nn.SELU(inplace=False)
Applied element-wise, as:
  \text{SELU}(x) = \text{scale} * (\max(0,x) + \min(0, \alpha *
  (\exp(x) - 1)))

with \alpha = 1.6732632423543772848170429916717 and \text{scale} =
   1.0507009873554804934193349852946.
Warning:
 When using "kaiming_normal" or "kaiming_normal_" for
 initialisation, "nonlinearity='linear'" should be used instead of
 "nonlinearity='selu'" in order to get Self-Normalizing Neural
 Networks. See "torch.nn.init.calculate_gain()" for more
 information.

More details can be found in the paper Self-Normalizing Neural
   Networks .
Parameters:
      inplace (bool, optional) -- can optionally do the
      operation in-place. Default: "False"
Shape:
      * Input: (*), where * means any number of dimensions.
  * Output: (*), same shape as the input.

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


torch.nn.functional.nll_loss
torch.nn.functional.nll_loss(input, target, weight=None, size_average=None, ignore_index=- 100, reduce=None, reduction='mean')
The negative log likelihood loss.
See "NLLLoss" for details.
Parameters:
      * input (Tensor) -- (N, C) where C = number of classes
        or (N, C, H, W) in case of 2D Loss, or (N, C, d_1, d_2, ...,
        d_K) where K \geq 1 in the case of K-dimensional loss. input
        is expected to be log-probabilities.
  * **target** (*Tensor*) -- (N) where each value is 0 \leq
    \text{targets}[i] \leq C-1, or (N, d_1, d_2, ..., d_K) where K
    \geq 1 for K-dimensional loss.

  * **weight** (*Tensor**, **optional*) -- a manual rescaling
    weight given to each class. If given, has to be a Tensor of
    size *C*

  * **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
        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"
  * **ignore_index** (*int**, **optional*) -- Specifies a target
    value that is ignored and does not contribute to the input
    gradient. When "size_average" is "True", the loss is averaged
    over non-ignored targets. Default: -100

  * **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'"
Return type:
      Tensor
Example:
  >>> # input is of size N x C = 3 x 5
  >>> input = torch.randn(3, 5, requires_grad=True)
  >>> # each element in target has to have 0 <= value < C
  >>> target = torch.tensor([1, 0, 4])
  >>> output = F.nll_loss(F.log_softmax(input, dim=1), target)
  >>> output.backward()


torch.compile
torch.compile(model=None, , fullgraph=False, dynamic=False, backend='inductor', mode=None, passes=None, *kwargs)
Optimizes given model/function using Dynamo and specified backend
Parameters:
      * model (Callable) -- Module/function to optimize
  * **fullgraph** (*bool*) -- Whether it is ok to break model into
    several subgraphs

  * **dynamic** (*bool*) -- Use dynamic shape tracing

  * **backend** (*str** or **Callable*) -- backend to be used

  * **mode** (*str*) -- Can be either "default", "reduce-overhead"
    or "max-autotune"

  * **passes** (*dict*) -- A dictionary of passes to the backend.
    Passes currently recognized by inductor backend: - static-
    memory - matmul-tune - matmul-padding - triton-autotune -
    triton-bmm - triton-mm - triton-convolution - rematerialize-
    threshold - rematerialize-acc-threshold

Return type:
      Callable
Example:


Return type:
      Callable
Example:
  @torch.compile(passes={"matmul-padding": True}, fullgraph=True)
  def foo(x):
      return torch.sin(x) + torch.cos(x)


torch.nn.functional.local_response_norm
torch.nn.functional.local_response_norm(input, size, alpha=0.0001, beta=0.75, k=1.0)
Applies local response normalization over an input signal composed
   of several input planes, where channels occupy the second
   dimension. Applies normalization across channels.
See "LocalResponseNorm" for details.
Return type:
      Tensor


torch.Tensor.kthvalue
Tensor.kthvalue(k, dim=None, keepdim=False)
See "torch.kthvalue()"


ModuleList
class torch.nn.ModuleList(modules=None)
Holds submodules in a list.
"ModuleList" can be indexed like a regular Python list, but modules
   it contains are properly registered, and will be visible by all
   "Module" methods.
Parameters:
      modules (iterable, optional) -- an iterable of modules
      to add
Example:
  class MyModule(nn.Module):
      def __init__(self):
          super(MyModule, self).__init__()
          self.linears = nn.ModuleList([nn.Linear(10, 10) for i in range(10)])

      def forward(self, x):
          # ModuleList can act as an iterable, or be indexed using ints
          for i, l in enumerate(self.linears):
              x = self.linears[i // 2](x) + l(x)
          return x

append(module)
  Appends a given module to the end of the list.

  Parameters:
     **module** (*nn.Module*) -- module to append

  Return type:
     *ModuleList*

extend(modules)


ModuleList
extend(modules)
  Appends modules from a Python iterable to the end of the list.

  Parameters:
     **modules** (*iterable*) -- iterable of modules to append

  Return type:
     *ModuleList*

insert(index, module)
  Insert a given module before a given index in the list.

  Parameters:
     * **index** (*int*) -- index to insert.

     * **module** (*nn.Module*) -- module to insert


torch.nn.functional.adaptive_max_pool1d
torch.nn.functional.adaptive_max_pool1d(args, *kwargs)
Applies a 1D adaptive max pooling over an input signal composed of
   several input planes.
See "AdaptiveMaxPool1d" for details and output shape.
Parameters:
      * output_size -- the target output size (single integer)
  * **return_indices** -- whether to return pooling indices.
    Default: "False"


FakeQuantize
class torch.quantization.fake_quantize.FakeQuantize(observer=, quant_min=None, quant_max=None, **observer_kwargs)
Simulate the quantize and dequantize operations in training time.
   The output of this module is given by:
  x_out = (
    clamp(round(x/scale + zero_point), quant_min, quant_max) - zero_point
  ) * scale

"scale" defines the scale factor used for quantization.

"zero_point" specifies the quantized value to which 0 in floating
     point maps to

"fake_quant_enabled" controls the application of fake
     quantization on tensors, note that statistics can still be
     updated.

"observer_enabled" controls statistics collection on tensors

"dtype" specifies the quantized dtype that is being emulated with
     fake-quantization,
        allowable values are torch.qint8 and torch.quint8.

Parameters:


Parameters:
      * observer (module) -- Module for observing statistics on
        input tensors and calculating scale and zero-point.
  * **observer_kwargs** (*optional*) -- Arguments for the observer
    module

Variables:
      activation_post_process (Module) -- User provided module
      that collects statistics on the input tensor and provides a
      method to calculate scale and zero-point.


torch.adjoint
torch.adjoint(Tensor) -> Tensor
Returns a view of the tensor conjugated and with the last two
   dimensions transposed.
"x.adjoint()" is equivalent to "x.transpose(-2, -1).conj()" for
   complex tensors and to "x.transpose(-2, -1)" for real tensors.
Example::
      >>> x = torch.arange(4, dtype=torch.float)
      >>> A = torch.complex(x, x).reshape(2, 2)
      >>> A
      tensor([[0.+0.j, 1.+1.j],
              [2.+2.j, 3.+3.j]])
      >>> A.adjoint()
      tensor([[0.-0.j, 2.-2.j],
              [1.-1.j, 3.-3.j]])
      >>> (A.adjoint() == A.mH).all()
      tensor(True)


Softmin
class torch.nn.Softmin(dim=None)
Applies the Softmin function to an n-dimensional input Tensor
   rescaling them so that the elements of the n-dimensional output
   Tensor lie in the range [0, 1] and sum to 1.
Softmin is defined as:
  \text{Softmin}(x_{i}) = \frac{\exp(-x_i)}{\sum_j \exp(-x_j)}

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

Parameters:
      dim (int) -- A dimension along which Softmin will be
      computed (so every slice along dim will sum to 1).
Returns:
      a Tensor of the same dimension and shape as the input, with
      values in the range [0, 1]
Return type:
      None
Examples:
  >>> m = nn.Softmin(dim=1)
  >>> input = torch.randn(2, 3)
  >>> output = m(input)


torch.Tensor.masked_scatter
Tensor.masked_scatter(mask, tensor) -> Tensor
Out-of-place version of "torch.Tensor.masked_scatter_()"


torch.nn.utils.parameters_to_vector
torch.nn.utils.parameters_to_vector(parameters)
Convert parameters to one vector
Parameters:
      parameters (Iterable[Tensor]) -- an iterator of
      Tensors that are the parameters of a model.
Returns:
      The parameters represented by a single vector
Return type:
      Tensor


default_debug_qconfig
torch.quantization.qconfig.default_debug_qconfig
alias of QConfig(activation=,
   weight=functools.partial(,
   dtype=torch.qint8, qscheme=torch.per_tensor_symmetric){})


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


torch.linalg.tensorinv
torch.linalg.tensorinv(A, ind=2, *, out=None) -> Tensor
Computes the multiplicative inverse of "torch.tensordot()".
If m is the product of the first "ind" dimensions of "A" and n
   is the product of the rest of the dimensions, this function expects
   m and n to be equal. If this is the case, it computes a tensor
   X such that tensordot("A", X, "ind") is the identity matrix
   in dimension m. X will have the shape of "A" but with the first
   "ind" dimensions pushed back to the end
  X.shape == A.shape[ind:] + A.shape[:ind]

Supports input of float, double, cfloat and cdouble dtypes.
Note:
 When "A" is a *2*-dimensional tensor and "ind"*= 1*, this
 function computes the (multiplicative) inverse of "A" (see
 "torch.linalg.inv()").

Note:
 Consider using "torch.linalg.tensorsolve()" if possible for
 multiplying a tensor on the left by the tensor inverse, as:


linalg.tensorsolve(A, B) == torch.tensordot(linalg.tensorinv(A), B)  # When B is a tensor with shape A.shape[:B.ndim]
 It is always preferred to use "tensorsolve()" when possible, as
 it is faster and more numerically stable than computing the
 pseudoinverse explicitly.

See also:
 "torch.linalg.tensorsolve()" computes
 *torch.tensordot(tensorinv(*"A"*), *"B"*)*.

Parameters:
      * A (Tensor) -- tensor to invert. Its shape must satisfy
        prod("A".shape[:"ind"]) == prod("A".shape["ind":]).
  * **ind** (*int*) -- index at which to compute the inverse of
    "torch.tensordot()". Default: *2*.

Keyword Arguments:
      out (Tensor, optional) -- output tensor. Ignored if
      None. Default: None.
Raises:
      RuntimeError -- if the reshaped "A" is not invertible or the
      product of the first     "ind" dimensions is not equal to the
      product of the rest.
Examples:


product of the rest.
Examples:
  >>> A = torch.eye(4 * 6).reshape((4, 6, 8, 3))
  >>> Ainv = torch.linalg.tensorinv(A, ind=2)
  >>> Ainv.shape
  torch.Size([8, 3, 4, 6])
  >>> B = torch.randn(4, 6)
  >>> torch.allclose(torch.tensordot(Ainv, B), torch.linalg.tensorsolve(A, B))
  True

  >>> A = torch.randn(4, 4)
  >>> Atensorinv = torch.linalg.tensorinv(A, ind=1)
  >>> Ainv = torch.linalg.inverse(A)
  >>> torch.allclose(Atensorinv, Ainv)
  True


torch.Tensor.apply_
Tensor.apply_(callable) -> Tensor
Applies the function "callable" to each element in the tensor,
   replacing each element with the value returned by "callable".
Note:
 This function only works with CPU tensors and should not be used
 in code sections that require high performance.


torch.softmax
torch.softmax(input, dim, *, dtype=None) -> Tensor
Alias for "torch.nn.functional.softmax()".


torch.randint
torch.randint(low=0, high, size, *, generator=None, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Returns a tensor filled with random integers generated uniformly
   between "low" (inclusive) and "high" (exclusive).
The shape of the tensor is defined by the variable argument "size".
Note:
 With the global dtype default ("torch.float32"), this function
 returns a tensor with dtype "torch.int64".

Parameters:
      * low (int, optional) -- Lowest integer to be drawn
        from the distribution. Default: 0.
  * **high** (*int*) -- One above the highest integer to be drawn
    from the distribution.

  * **size** (*tuple*) -- a tuple defining the shape of the output
    tensor.

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


dtype (torch.dtype, optional) -- if "None", this
        function returns a tensor with dtype "torch.int64".

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

Example:
  >>> torch.randint(3, 5, (3,))
  tensor([4, 3, 4])

  >>> torch.randint(10, (2, 2))
  tensor([[0, 2],
          [5, 5]])

  >>> torch.randint(3, 10, (2, 2))
  tensor([[4, 5],
          [6, 7]])


torch.Tensor.hardshrink
Tensor.hardshrink(lambd=0.5) -> Tensor
See "torch.nn.functional.hardshrink()"


get_default_qconfig_mapping
class torch.ao.quantization.qconfig_mapping.get_default_qconfig_mapping(backend='x86', version=0)
Return the default QConfigMapping for post training quantization.
Parameters:
      * backend (***) -- the quantization backend for the default
        qconfig mapping, should be one of ["x86" (default), "fbgemm",
        "qnnpack", "onednn"]
  * **version** (***) -- the version for the default qconfig
    mapping

Return type:
      QConfigMapping


QuantStub
class torch.quantization.QuantStub(qconfig=None)
Quantize stub module, before calibration, this is same as an
   observer, it will be swapped as nnq.Quantize in convert.
Parameters:
      qconfig -- quantization configuration for the tensor, if
      qconfig is not provided, we will get qconfig from parent modules


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

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

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


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

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

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.randn(4, 2) < 0
  >>> a
  tensor([[ True,  True],
          [False,  True],
          [ True,  True],
          [False, False]])
  >>> torch.any(a, 1)
  tensor([ True,  True,  True, False])
  >>> torch.any(a, 0)
  tensor([True, True])


torch.Tensor.chunk
Tensor.chunk(chunks, dim=0) -> List of Tensors
See "torch.chunk()"


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


torch.Tensor.sparse_resize_
Tensor.sparse_resize_(size, sparse_dim, dense_dim) -> Tensor
Resizes "self" sparse tensor to the desired size and the number of
   sparse and dense dimensions.
Note:
 If the number of specified elements in "self" is zero, then
 "size", "sparse_dim", and "dense_dim" can be any size and
 positive integers such that "len(size) == sparse_dim +
 dense_dim".If "self" specifies one or more elements, however,
 then each dimension in "size" must not be smaller than the
 corresponding dimension of "self", "sparse_dim" must equal the
 number of sparse dimensions in "self", and "dense_dim" must equal
 the number of dense dimensions in "self".

Warning:
 Throws an error if "self" is not a sparse tensor.

Parameters:
      * size (torch.Size) -- the desired size. If "self" is non-
        empty sparse tensor, the desired size cannot be smaller than
        the original size.


the original size.
  * **sparse_dim** (*int*) -- the number of sparse dimensions

  * **dense_dim** (*int*) -- the number of dense dimensions


torch.linalg.multi_dot
torch.linalg.multi_dot(tensors, *, out=None)
Efficiently multiplies two or more matrices by reordering the
   multiplications so that the fewest arithmetic operations are
   performed.
Supports inputs of float, double, cfloat and cdouble dtypes. This
   function does not support batched inputs.
Every tensor in "tensors" must be 2D, except for the first and last
   which may be 1D. If the first tensor is a 1D vector of shape (n,)
   it is treated as a row vector of shape (1, n), similarly if the
   last tensor is a 1D vector of shape (n,) it is treated as a
   column vector of shape (n, 1).
If the first and last tensors are matrices, the output will be a
   matrix. However, if either is a 1D vector, then the output will be
   a 1D vector.
Differences with numpy.linalg.multi_dot:

Unlike numpy.linalg.multi_dot, the first and last tensors must
     either be 1D or 2D whereas NumPy allows them to be nD

Warning:


Warning:
 This function does not broadcast.

Note:
 This function is implemented by chaining "torch.mm()" calls after
 computing the optimal matrix multiplication order.

Note:
 The cost of multiplying two matrices with shapes *(a, b)* and
 *(b, c)* is *a * b * c*. Given matrices *A*, *B*, *C* with shapes
 *(10, 100)*, *(100, 5)*, *(5, 50)* respectively, we can calculate
 the cost of different multiplication orders as follows:

    \begin{align*} \operatorname{cost}((AB)C) &= 10 \times 100
    \times 5 + 10 \times 5 \times 50 = 7500 \\
    \operatorname{cost}(A(BC)) &= 10 \times 100 \times 50 + 100
    \times 5 \times 50 = 75000 \end{align*}

 In this case, multiplying *A* and *B* first followed by *C* is 10
 times faster.

Parameters:
      tensors (Sequence[Tensor]) -- two or more tensors to
      multiply. The first and last tensors may be 1D or 2D. Every
      other tensor must be 2D.
Keyword Arguments:


Keyword Arguments:
      out (Tensor, optional) -- output tensor. Ignored if
      None. Default: None.
Examples:
  >>> from torch.linalg import multi_dot

  >>> multi_dot([torch.tensor([1, 2]), torch.tensor([2, 3])])
  tensor(8)
  >>> multi_dot([torch.tensor([[1, 2]]), torch.tensor([2, 3])])
  tensor([8])
  >>> multi_dot([torch.tensor([[1, 2]]), torch.tensor([[2], [3]])])
  tensor([[8]])

  >>> A = torch.arange(2 * 3).view(2, 3)
  >>> B = torch.arange(3 * 2).view(3, 2)
  >>> C = torch.arange(2 * 2).view(2, 2)
  >>> multi_dot((A, B, C))
  tensor([[ 26,  49],
          [ 80, 148]])


default_qconfig
torch.quantization.qconfig.default_qconfig
alias of QConfig(activation=functools.partial(, quant_min=0,
   quant_max=127){}, weight=functools.partial(,
   dtype=torch.qint8, qscheme=torch.per_tensor_symmetric){})


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

Parameters:
      * input (Tensor) -- the input value(s), "torch.float32"
        tensor
  * **scale** (double scalar or "float32" Tensor) -- quantization
    scale

  * **zero_point** (int64 scalar or "int32" Tensor) --
    quantization zero_point

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

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

Returns:
      A newly fake_quantized "torch.float32" tensor
Return type:
      Tensor
Example:


Return type:
      Tensor
Example:
  >>> x = torch.randn(4)
  >>> x
  tensor([ 0.0552,  0.9730,  0.3973, -1.0780])
  >>> torch.fake_quantize_per_tensor_affine(x, 0.1, 0, 0, 255)
  tensor([0.1000, 1.0000, 0.4000, 0.0000])
  >>> torch.fake_quantize_per_tensor_affine(x, torch.tensor(0.1), torch.tensor(0), 0, 255)
  tensor([0.6000, 0.4000, 0.0000, 0.0000])


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


torch.Tensor.view
Tensor.view(*shape) -> Tensor
Returns a new tensor with the same data as the "self" tensor but of
   a different "shape".
The returned tensor shares the same data and must have the same
   number of elements, but may have a different size. For a tensor to
   be viewed, the new view size must be compatible with its original
   size and stride, i.e., each new view dimension must either be a
   subspace of an original dimension, or only span across original
   dimensions d, d+1, \dots, d+k that satisfy the following
   contiguity-like condition that \forall i = d, \dots, d+k-1,
  \text{stride}[i] = \text{stride}[i+1] \times \text{size}[i+1]

Otherwise, it will not be possible to view "self" tensor as "shape"
   without copying it (e.g., via "contiguous()"). When it is unclear
   whether a "view()" can be performed, it is advisable to use
   "reshape()", which returns a view if the shapes are compatible, and


copies (equivalent to calling "contiguous()") otherwise.
Parameters:
      shape (torch.Size or int...) -- the desired size
Example:
  >>> x = torch.randn(4, 4)
  >>> x.size()
  torch.Size([4, 4])
  >>> y = x.view(16)
  >>> y.size()
  torch.Size([16])
  >>> z = x.view(-1, 8)  # the size -1 is inferred from other dimensions
  >>> z.size()
  torch.Size([2, 8])

  >>> a = torch.randn(1, 2, 3, 4)
  >>> a.size()
  torch.Size([1, 2, 3, 4])
  >>> b = a.transpose(1, 2)  # Swaps 2nd and 3rd dimension
  >>> b.size()
  torch.Size([1, 3, 2, 4])
  >>> c = a.view(1, 3, 2, 4)  # Does not change tensor layout in memory
  >>> c.size()
  torch.Size([1, 3, 2, 4])
  >>> torch.equal(b, c)
  False

view(dtype) -> Tensor
Returns a new tensor with the same data as the "self" tensor but of
   a different "dtype".
If the element size of "dtype" is different than that of


"self.dtype", then the size of the last dimension of the output
   will be scaled proportionally.  For instance, if "dtype" element
   size is twice that of "self.dtype", then each pair of elements in
   the last dimension of "self" will be combined, and the size of the
   last dimension of the output will be half that of "self". If
   "dtype" element size is half that of "self.dtype", then each
   element in the last dimension of "self" will be split in two, and
   the size of the last dimension of the output will be double that of
   "self". For this to be possible, the following conditions must be
   true:
  * "self.dim()" must be greater than 0.

  * "self.stride(-1)" must be 1.

Additionally, if the element size of "dtype" is greater than that
   of "self.dtype", the following conditions must be true as well:
  * "self.size(-1)" must be divisible by the ratio between the
    element sizes of the dtypes.

  * "self.storage_offset()" must be divisible by the ratio between


the element sizes of the dtypes.
  * The strides of all dimensions, except the last dimension, must
    be divisible by the ratio between the element sizes of the
    dtypes.

If any of the above conditions are not met, an error is thrown.
Warning:
 This overload is not supported by TorchScript, and using it in a
 Torchscript program will cause undefined behavior.

Parameters:
      dtype ("torch.dtype") -- the desired dtype
Example:
  >>> x = torch.randn(4, 4)
  >>> x
  tensor([[ 0.9482, -0.0310,  1.4999, -0.5316],
          [-0.1520,  0.7472,  0.5617, -0.8649],
          [-2.4724, -0.0334, -0.2976, -0.8499],
          [-0.2109,  1.9913, -0.9607, -0.6123]])
  >>> x.dtype
  torch.float32

  >>> y = x.view(torch.int32)
  >>> y
  tensor([[ 1064483442, -1124191867,  1069546515, -1089989247],
          [-1105482831,  1061112040,  1057999968, -1084397505],


[-1071760287, -1123489973, -1097310419, -1084649136],
              [-1101533110,  1073668768, -1082790149, -1088634448]],
          dtype=torch.int32)
      >>> y[0, 0] = 1000000000
      >>> x
      tensor([[ 0.0047, -0.0310,  1.4999, -0.5316],
              [-0.1520,  0.7472,  0.5617, -0.8649],
              [-2.4724, -0.0334, -0.2976, -0.8499],
              [-0.2109,  1.9913, -0.9607, -0.6123]])
  >>> x.view(torch.cfloat)
  tensor([[ 0.0047-0.0310j,  1.4999-0.5316j],
          [-0.1520+0.7472j,  0.5617-0.8649j],
          [-2.4724-0.0334j, -0.2976-0.8499j],
          [-0.2109+1.9913j, -0.9607-0.6123j]])
  >>> x.view(torch.cfloat).size()
  torch.Size([4, 2])

  >>> x.view(torch.uint8)
  tensor([[  0, 202, 154,  59, 182, 243, 253, 188, 185, 252, 191,  63, 240,  22,
             8, 191],
          [227, 165,  27, 190, 128,  72,  63,  63, 146, 203,  15,  63,  22, 106,
            93, 191],


93, 191],
              [205,  59,  30, 192, 112, 206,   8, 189,   7,  95, 152, 190,  12, 147,
                89, 191],
              [ 43, 246,  87, 190, 235, 226, 254,  63, 111, 240, 117, 191, 177, 191,
                28, 191]], dtype=torch.uint8)
      >>> x.view(torch.uint8).size()
      torch.Size([4, 16])


MultiStepLR
class torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones, gamma=0.1, last_epoch=- 1, verbose=False)
Decays the learning rate of each parameter group by gamma once the
   number of epoch reaches one of the milestones. Notice that such
   decay can happen simultaneously with other changes to the learning
   rate from outside this scheduler. When last_epoch=-1, sets initial
   lr as lr.
Parameters:
      * optimizer (Optimizer) -- Wrapped optimizer.
  * **milestones** (*list*) -- List of epoch indices. Must be
    increasing.

  * **gamma** (*float*) -- Multiplicative factor of learning rate
    decay. Default: 0.1.

  * **last_epoch** (*int*) -- The index of last epoch. Default:
    -1.

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

-[ Example ]-

Assuming optimizer uses lr = 0.05 for all groups
lr = 0.05     if epoch < 30


lr = 0.05     if epoch < 30
lr = 0.005    if 30 <= epoch < 80
lr = 0.0005   if epoch >= 80
scheduler = MultiStepLR(optimizer, milestones=[30,80], gamma=0.1)
for epoch in range(100):
    train(...)
    validate(...)
    scheduler.step()

get_last_lr()
  Return last computed learning rate by current scheduler.

load_state_dict(state_dict)
  Loads the schedulers state.

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

print_lr(is_verbose, group, lr, epoch=None)
  Display the current learning rate.

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

  It contains an entry for every variable in self.__dict__ which
  is not the optimizer.


torch.Tensor.sqrt_
Tensor.sqrt_() -> Tensor
In-place version of "sqrt()"


torch.autograd.function.FunctionCtx.save_for_backward
FunctionCtx.save_for_backward(*tensors)
Saves given tensors for a future call to "backward()".
"save_for_backward" should be called at most once, only from inside
   the "forward()" method, and only with tensors.
All tensors intended to be used in the backward pass should be
   saved with "save_for_backward" (as opposed to directly on "ctx") to
   prevent incorrect gradients and memory leaks, and enable the
   application of saved tensor hooks. See
   "torch.autograd.graph.saved_tensors_hooks".
Note that if intermediary tensors, tensors that are neither inputs
   nor outputs of "forward()", are saved for backward, your custom
   Function may not support double backward. Custom Functions that do
   not support double backward should decorate their "backward()"
   method with "@once_differentiable" so that performing double


backward raises an error. If you'd like to support double backward,
   you can either recompute intermediaries based on the inputs during
   backward or return the intermediaries as the outputs of the custom
   Function. See the double backward tutorial for more details.
In "backward()", saved tensors can be accessed through the
   "saved_tensors" attribute. Before returning them to the user, a
   check is made to ensure they weren't used in any in-place operation
   that modified their content.
Arguments can also be "None". This is a no-op.
See Extending torch.autograd for more details on how to use this
   method.
Example::
      >>> class Func(Function):
      >>>     @staticmethod
      >>>     def forward(ctx, x: torch.Tensor, y: torch.Tensor, z: int):
      >>>         w = x * z
      >>>         out = x * y + y * z + w * y
      >>>         ctx.save_for_backward(x, y, w, out)
      >>>         ctx.z = z  # z is not a tensor
      >>>         return out
      >>>


    return out
  >>>
  >>>     @staticmethod
  >>>     @once_differentiable
  >>>     def backward(ctx, grad_out):
  >>>         x, y, w, out = ctx.saved_tensors
  >>>         z = ctx.z
  >>>         gx = grad_out * (y + y * z)
  >>>         gy = grad_out * (x + z + w)
  >>>         gz = None
  >>>         return gx, gy, gz
  >>>
  >>> a = torch.tensor(1., requires_grad=True, dtype=torch.double)
  >>> b = torch.tensor(2., requires_grad=True, dtype=torch.double)
  >>> c = 4
  >>> d = Func.apply(a, b, c)


torch.full
torch.full(size, fill_value, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Creates a tensor of size "size" filled with "fill_value". The
   tensor's dtype is inferred from "fill_value".
Parameters:
      * size (int...) -- a list, tuple, or "torch.Size" of
        integers defining the shape of the output tensor.
  * **fill_value** (*Scalar*) -- the value to fill the output
    tensor with.

Keyword Arguments:
      * out (Tensor, optional) -- the output tensor.
  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor. Default: if "None", uses a global default
    (see "torch.set_default_tensor_type()").

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

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


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

Example:
  >>> torch.full((2, 3), 3.141592)
  tensor([[ 3.1416,  3.1416,  3.1416],
          [ 3.1416,  3.1416,  3.1416]])


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


default_dynamic_quant_observer
torch.quantization.observer.default_dynamic_quant_observer
alias of functools.partial(,
   dtype=torch.quint8, quant_min=0, quant_max=255, is_dynamic=True){}


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


torch.matrix_exp
torch.matrix_exp(A) -> Tensor
Alias for "torch.linalg.matrix_exp()".


torch.nanquantile
torch.nanquantile(input, q, dim=None, keepdim=False, *, interpolation='linear', out=None) -> Tensor
This is a variant of "torch.quantile()" that "ignores" "NaN"
   values, computing the quantiles "q" as if "NaN" values in "input"
   did not exist. If all values in a reduced row are "NaN" then the
   quantiles for that reduction will be "NaN". See the documentation
   for "torch.quantile()".
Parameters:
      * input (Tensor) -- the input tensor.
  * **q** (*float** or **Tensor*) -- a scalar or 1D tensor of
    quantile values in the range [0, 1]

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

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

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


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

Example:
  >>> t = torch.tensor([float('nan'), 1, 2])
  >>> t.quantile(0.5)
  tensor(nan)
  >>> t.nanquantile(0.5)
  tensor(1.5000)
  >>> t = torch.tensor([[float('nan'), float('nan')], [1, 2]])
  >>> t
  tensor([[nan, nan],
          [1., 2.]])
  >>> t.nanquantile(0.5, dim=0)
  tensor([1., 2.])
  >>> t.nanquantile(0.5, dim=1)
  tensor([   nan, 1.5000])


torch.aminmax
torch.aminmax(input, *, dim=None, keepdim=False, out=None) -> (Tensor min, Tensor max)
Computes the minimum and maximum values of the "input" tensor.
Parameters:
      input (Tensor) -- The input tensor
Keyword Arguments:
      * dim (Optional[int]) -- The dimension along which
        to compute the values. If None, computes the values over the
        entire "input" tensor. Default is None.
  * **keepdim** (*bool*) -- If *True*, the reduced dimensions will
    be kept in the output tensor as dimensions with size 1 for
    broadcasting, otherwise they will be removed, as if calling
    ("torch.squeeze()"). Default is *False*.

  * **out** (*Optional**[**Tuple**[**Tensor**, **Tensor**]**]*) --
    Optional tensors on which to write the result. Must have the
    same shape and dtype as the expected output. Default is
    *None*.

Returns:
      A named tuple (min, max) containing the minimum and maximum


values.
Raises:
      RuntimeError -- If any of the dimensions to compute the
      values over has size 0.
Note:
 NaN values are propagated to the output if at least one value is
 NaN.

See also:
 "torch.amin()" computes just the minimum value "torch.amax()"
 computes just the maximum value

Example:
  >>> torch.aminmax(torch.tensor([1, -3, 5]))
  torch.return_types.aminmax(
  min=tensor(-3),
  max=tensor(5))

  >>> # aminmax propagates NaNs
  >>> torch.aminmax(torch.tensor([1, -3, 5, torch.nan]))
  torch.return_types.aminmax(
  min=tensor(nan),
  max=tensor(nan))

  >>> t = torch.arange(10).view(2, 5)
  >>> t
  tensor([[0, 1, 2, 3, 4],
          [5, 6, 7, 8, 9]])
  >>> t.aminmax(dim=0, keepdim=True)
  torch.return_types.aminmax(
  min=tensor([[0, 1, 2, 3, 4]]),
  max=tensor([[5, 6, 7, 8, 9]]))


torch.autograd.functional.jacobian
torch.autograd.functional.jacobian(func, inputs, create_graph=False, strict=False, vectorize=False, strategy='reverse-mode')
Function that computes the Jacobian of a given function.
Parameters:
      * func (function) -- a Python function that takes Tensor
        inputs and returns a tuple of Tensors or a Tensor.
  * **inputs** (*tuple of Tensors** or **Tensor*) -- inputs to the
    function "func".

  * **create_graph** (*bool**, **optional*) -- If "True", the
    Jacobian will be computed in a differentiable manner. Note
    that when "strict" is "False", the result can not require
    gradients or be disconnected from the inputs.  Defaults to
    "False".

  * **strict** (*bool**, **optional*) -- If "True", an error will
    be raised when we detect that there exists an input such that
    all the outputs are independent of it. If "False", we return a


Tensor of zeros as the jacobian for said inputs, which is the
        expected mathematical value. Defaults to "False".
  * **vectorize** (*bool**, **optional*) -- This feature is
    experimental. Please consider using "torch.func.jacrev()" or
    "torch.func.jacfwd()" instead if you are looking for something
    less experimental and more performant. When computing the
    jacobian, usually we invoke "autograd.grad" once per row of
    the jacobian. If this flag is "True", we perform only a single
    "autograd.grad" call with "batched_grad=True" which uses the
    vmap prototype feature. Though this should lead to performance
    improvements in many cases, because this feature is still
    experimental, there may be performance cliffs. See
    "torch.autograd.grad()"'s "batched_grad" parameter for more
    information.

  * **strategy** (*str**, **optional*) -- Set to ""forward-mode""


or ""reverse-mode"" to determine whether the Jacobian will be
        computed with forward or reverse mode AD. Currently,
        ""forward-mode"" requires "vectorized=True". Defaults to
        ""reverse-mode"". If "func" has more outputs than inputs,
        ""forward-mode"" tends to be more performant. Otherwise,
        prefer to use ""reverse-mode"".
Returns:
      if there is a single input and output, this will be a single
      Tensor containing the Jacobian for the linearized inputs and
      output. If one of the two is a tuple, then the Jacobian will be
      a tuple of Tensors. If both of them are tuples, then the
      Jacobian will be a tuple of tuple of Tensors where
      "Jacobian[i][j]" will contain the Jacobian of the "i"th output
      and "j"th input and will have as size the concatenation of the
      sizes of the corresponding output and the corresponding input
      and will have same dtype and device as the corresponding input.


If strategy is "forward-mode", the dtype will be that of the
      output; otherwise, the input.
Return type:
      Jacobian (Tensor or nested tuple of Tensors)
-[ Example ]-

def exp_reducer(x):
   ...     return x.exp().sum(dim=1)
inputs = torch.rand(2, 2)
jacobian(exp_reducer, inputs)
   tensor([[[1.4917, 2.4352],
            [0.0000, 0.0000]],
           [[0.0000, 0.0000],
            [2.4369, 2.3799]]])
jacobian(exp_reducer, inputs, create_graph=True)
   tensor([[[1.4917, 2.4352],
            [0.0000, 0.0000]],
           [[0.0000, 0.0000],
            [2.4369, 2.3799]]], grad_fn=)
def exp_adder(x, y):
   ...     return 2 * x.exp() + 3 * y
inputs = (torch.rand(2), torch.rand(2))
jacobian(exp_adder, inputs)
   (tensor([[2.8052, 0.0000],
           [0.0000, 3.3963]]),
    tensor([[3., 0.],
            [0., 3.]]))


BatchNorm3d
class torch.ao.nn.quantized.BatchNorm3d(num_features, eps=1e-05, momentum=0.1, device=None, dtype=None)
This is the quantized version of "BatchNorm3d".


torch.nonzero
torch.nonzero(input, *, out=None, as_tuple=False) -> LongTensor or tuple of LongTensors
Note:
 "torch.nonzero(..., as_tuple=False)" (default) returns a 2-D
 tensor where each row is the index for a nonzero
 value."torch.nonzero(..., as_tuple=True)" returns a tuple of 1-D
 index tensors, allowing for advanced indexing, so
 "x[x.nonzero(as_tuple=True)]" gives all nonzero values of tensor
 "x". Of the returned tuple, each index tensor contains nonzero
 indices for a certain dimension.See below for more details on the
 two behaviors.When "input" is on CUDA, "torch.nonzero()" causes
 host-device synchronization.

When "as_tuple" is "False" (default):
Returns a tensor containing the indices of all non-zero elements of
   "input".  Each row in the result contains the indices of a non-zero
   element in "input". The result is sorted lexicographically, with
   the last index changing the fastest (C-style).


the last index changing the fastest (C-style).
If "input" has n dimensions, then the resulting indices tensor
   "out" is of size (z \times n), where z is the total number of non-
   zero elements in the "input" tensor.
When "as_tuple" is "True":
Returns a tuple of 1-D tensors, one for each dimension in "input",
   each containing the indices (in that dimension) of all non-zero
   elements of "input" .
If "input" has n dimensions, then the resulting tuple contains n
   tensors of size z, where z is the total number of non-zero elements
   in the "input" tensor.
As a special case, when "input" has zero dimensions and a nonzero
   scalar value, it is treated as a one-dimensional tensor with one
   element.
Parameters:
      input (Tensor) -- the input tensor.
Keyword Arguments:
      out (LongTensor, optional) -- the output tensor
      containing indices
Returns:
      If "as_tuple" is "False", the output tensor containing indices.


If "as_tuple" is "True", one 1-D tensor for each dimension,
      containing the indices of each nonzero element along that
      dimension.
Return type:
      LongTensor or tuple of LongTensor
Example:
  >>> torch.nonzero(torch.tensor([1, 1, 1, 0, 1]))
  tensor([[ 0],
          [ 1],
          [ 2],
          [ 4]])
  >>> torch.nonzero(torch.tensor([[0.6, 0.0, 0.0, 0.0],
  ...                             [0.0, 0.4, 0.0, 0.0],
  ...                             [0.0, 0.0, 1.2, 0.0],
  ...                             [0.0, 0.0, 0.0,-0.4]]))
  tensor([[ 0,  0],
          [ 1,  1],
          [ 2,  2],
          [ 3,  3]])
  >>> torch.nonzero(torch.tensor([1, 1, 1, 0, 1]), as_tuple=True)
  (tensor([0, 1, 2, 4]),)
  >>> torch.nonzero(torch.tensor([[0.6, 0.0, 0.0, 0.0],
  ...                             [0.0, 0.4, 0.0, 0.0],
  ...                             [0.0, 0.0, 1.2, 0.0],


...                             [0.0, 0.0, 0.0,-0.4]]), as_tuple=True)
      (tensor([0, 1, 2, 3]), tensor([0, 1, 2, 3]))
      >>> torch.nonzero(torch.tensor(5), as_tuple=True)
      (tensor([0]),)


torch.set_default_dtype
torch.set_default_dtype(d)
Sets the default floating point dtype to "d". Supports
   torch.float32 and torch.float64 as inputs. Other dtypes may be
   accepted without complaint but are not supported and are unlikely
   to work as expected.
When PyTorch is initialized its default floating point dtype is
   torch.float32, and the intent of set_default_dtype(torch.float64)
   is to facilitate NumPy-like type inference. The default floating
   point dtype is used to:

Implicitly determine the default complex dtype. When the default
      floating point type is float32 the default complex dtype is
      complex64, and when the default floating point type is float64
      the default complex type is complex128.

Infer the dtype for tensors constructed using Python floats or
      complex Python numbers. See examples below.

Determine the result of type promotion between bool and integer


tensors and Python floats and complex Python numbers.
Parameters:
      d ("torch.dtype") -- the floating point dtype to make the
      default. Either torch.float32 or torch.float64.
-[ Example ]-

initial default for floating point is torch.float32
Python floats are interpreted as float32
torch.tensor([1.2, 3]).dtype
   torch.float32
initial default for floating point is torch.complex64
Complex Python numbers are interpreted as complex64
torch.tensor([1.2, 3j]).dtype
   torch.complex64
torch.set_default_dtype(torch.float64)
Python floats are now interpreted as float64
torch.tensor([1.2, 3]).dtype    # a new floating point tensor
   torch.float64
Complex Python numbers are now interpreted as complex128
torch.tensor([1.2, 3j]).dtype   # a new complex tensor
   torch.complex128


torch.arctan2
torch.arctan2(input, other, *, out=None) -> Tensor
Alias for "torch.atan2()".


torch.Tensor.trunc_
Tensor.trunc_() -> Tensor
In-place version of "trunc()"


RandomStructured
class torch.nn.utils.prune.RandomStructured(amount, dim=- 1)
Prune entire (currently unpruned) channels in a tensor at random.
Parameters:
      * 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.
  * **dim** (*int**, **optional*) -- index of the dim along which
    we define channels to prune. Default: -1.

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


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.

     * **dim** (*int**, **optional*) -- index of the dim along
       which we define channels to prune. Default: -1.

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)

compute_mask(t, default_mask)
  Computes and returns a mask for the input tensor "t". Starting


from a base "default_mask" (which should be a mask of ones if
      the tensor has not been pruned yet), generate a random mask to
      apply on top of the "default_mask" by randomly zeroing out
      channels along the specified dim of the tensor.
  Parameters:
     * **t** (*torch.Tensor*) -- tensor representing the parameter
       to prune

     * **default_mask** (*torch.Tensor*) -- Base mask from
       previous pruning iterations, that need to be respected
       after the new mask is applied. Same dims as "t".

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

  Return type:
     mask (torch.Tensor)

  Raises:
     **IndexError** -- if "self.dim >= len(t.shape)"

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

  Parameters:
     * **t** (*torch.Tensor*) -- tensor to prune (of same


dimensions as "default_mask").
     * **importance_scores** (*torch.Tensor*) -- tensor of
       importance scores (of same shape as "t") used to compute
       mask for pruning "t". The values in this tensor indicate
       the importance of the corresponding elements in the "t"
       that is being pruned. If unspecified or None, the tensor
       "t" will be used in its place.

     * **default_mask** (*torch.Tensor**, **optional*) -- mask
       from previous pruning iteration, if any. To be considered
       when determining what portion of the tensor that pruning
       should act on. If None, default to a mask of ones.

  Returns:
     pruned version of tensor "t".

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


list. Similarly, the buffer named "name+'_mask'" is removed from
      the buffers.
  Note:

    Pruning itself is NOT undone or reversed!


torch.cuda.get_rng_state_all
torch.cuda.get_rng_state_all()
Returns a list of ByteTensor representing the random number states
   of all devices.
Return type:
      List[Tensor]


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


torch.cuda.seed_all
torch.cuda.seed_all()
Sets the seed for generating random numbers to a random number on
   all GPUs. It's safe to call this function if CUDA is not available;
   in that case, it is silently ignored.


set_grad_enabled
class torch.set_grad_enabled(mode)
Context-manager that sets gradient calculation on or off.
"set_grad_enabled" will enable or disable grads based on its
   argument "mode". It can be used as a context-manager or as a
   function.
This context manager is thread local; it will not affect
   computation in other threads.
Parameters:
      mode (bool) -- Flag whether to enable grad ("True"), or
      disable ("False"). This can be used to conditionally enable
      gradients.
Note:
 set_grad_enabled is one of several mechanisms that can enable or
 disable gradients locally see Locally disabling gradient
 computation for more information on how they compare.

Note:
 This API does not apply to forward-mode AD.

Example::
      >>> x = torch.tensor([1.], requires_grad=True)
      >>> is_train = False
      >>> with torch.set_grad_enabled(is_train):
      ...     y = x * 2
      >>> y.requires_grad
      False


y.requires_grad
      False
      >>> _ = torch.set_grad_enabled(True)
      >>> y = x * 2
      >>> y.requires_grad
      True
      >>> _ = torch.set_grad_enabled(False)
      >>> y = x * 2
      >>> y.requires_grad
      False


torch.nn.functional.fractional_max_pool2d
torch.nn.functional.fractional_max_pool2d(args, *kwargs)
Applies 2D fractional max pooling over an input signal composed of
   several input planes.
Fractional MaxPooling is described in detail in the paper
   Fractional MaxPooling by Ben Graham
The max-pooling operation is applied in kH \times kW regions by a
   stochastic step size determined by the target output size. The
   number of output features is equal to the number of input planes.
Parameters:
      * kernel_size -- the size of the window to take a max over.
        Can be a single number k (for a square kernel of k \times k)
        or a tuple (kH, kW)
  * **output_size** -- the target output size of the image of the
    form oH \times oW. Can be a tuple *(oH, oW)* or a single
    number oH for a square image oH \times oH

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


ratio of the input size, this option can be given. This has to
        be a number or tuple in the range (0, 1)
  * **return_indices** -- if "True", will return the indices along
    with the outputs. Useful to pass to "max_unpool2d()".

Examples::
      >>> input = torch.randn(20, 16, 50, 32)
      >>> # pool of square window of size=3, and target output size 13x12
      >>> F.fractional_max_pool2d(input, 3, output_size=(13, 12))
      >>> # pool of square window and target output size being half of input image size
      >>> F.fractional_max_pool2d(input, 3, output_ratio=(0.5, 0.5))


torch.nn.functional.batch_norm
torch.nn.functional.batch_norm(input, running_mean, running_var, weight=None, bias=None, training=False, momentum=0.1, eps=1e-05)
Applies Batch Normalization for each channel across a batch of
   data.
See "BatchNorm1d", "BatchNorm2d", "BatchNorm3d" for details.
Return type:
      Tensor


torch.jit.set_fusion_strategy
torch.jit.set_fusion_strategy(strategy)
Sets the type and number of specializations that can occur during
   fusion.
Usage: provide a list of pairs (type, depth) where type is one of
   "STATIC" or "DYNAMIC" and depth is an integer.
Behavior - static vs dynamic:
      In STATIC fusion, fused ops are compiled to have fixed input
      shapes. The shape is determined based on some initial profiling
      runs. In DYNAMIC fusion, fused ops are compiled to have variable
      input shapes, so that multiple shapes are possible.
In both cases, we also recompile on new striding behavior, device,
   or dtype.
Behavior - fallback functions & depth:
      When an input doesn't match the format required by the
      specialized compiled op, it will run a fallback function.
      Fallback functions are recursively be compiled and specialized
      based on the observed tensor shapes. Since compilation can be


slow, the "depth" parameter is provided to limit the number of
      specializations that can be compiled, before giving up on
      recompiling and falling back to a completely un-fused, un-
      specialized implementation.
The list of (type, depth) pairs controls the type of
   specializations and the number of specializations. For example:
   [("STATIC", 2), ("DYNAMIC", 2)] indicates that the first two
   specializations will use static fusions, the following two
   specializations will use dynamic fusion, and any inputs that
   satisfy none of the 4 options will run an unfused implementation.
NB: in the future, if more as more fusion backends are added there
   may be more granular apis for specific fusers.


torch.Tensor.lgamma_
Tensor.lgamma_() -> Tensor
In-place version of "lgamma()"


torch.linalg.matmul
torch.linalg.matmul(input, other, *, out=None) -> Tensor
Alias for "torch.matmul()"


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

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}, W_{out})=\text{output\_size}.

-[ Examples ]-

target output size of 5x7
m = nn.AdaptiveMaxPool2d((5, 7))
input = torch.randn(1, 64, 8, 9)
output = m(input)
target output size of 7x7 (square)
m = nn.AdaptiveMaxPool2d(7)
input = torch.randn(1, 64, 10, 9)
output = m(input)
target output size of 10x7
m = nn.AdaptiveMaxPool2d((None, 7))
input = torch.randn(1, 64, 10, 9)
output = m(input)


torch.Tensor.slice_scatter
Tensor.slice_scatter(src, dim=0, start=None, end=None, step=1) -> Tensor
See "torch.slice_scatter()"


torch.Tensor.cov
Tensor.cov(*, correction=1, fweights=None, aweights=None) -> Tensor
See "torch.cov()"


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

Warning:
 This class is deprecated in favor of "interpolate()". It is
 equivalent to "nn.functional.interpolate(..., mode='bilinear',
 align_corners=True)".

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

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


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

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

  >>> m = nn.UpsamplingBilinear2d(scale_factor=2)
  >>> m(input)
  tensor([[[[1.0000, 1.3333, 1.6667, 2.0000],
            [1.6667, 2.0000, 2.3333, 2.6667],
            [2.3333, 2.6667, 3.0000, 3.3333],
            [3.0000, 3.3333, 3.6667, 4.0000]]]])


AvgPool2d
class torch.nn.AvgPool2d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None)
Applies a 2D average 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:
  out(N_i, C_j, h, w)  = \frac{1}{kH * kW} \sum_{m=0}^{kH-1}
  \sum_{n=0}^{kW-1}                        input(N_i, C_j,
  stride[0] \times h + m, stride[1] \times w + n)

If "padding" is non-zero, then the input is implicitly zero-padded
   on both sides for "padding" number of points.
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" 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
  * **stride** (*Union**[**int**, **Tuple**[**int**, **int**]**]*)
    -- the stride of the window. Default value is "kernel_size"

  * **padding** (*Union**[**int**, **Tuple**[**int**,
    **int**]**]*) -- implicit zero padding to be added on both
    sides

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

  * **count_include_pad** (*bool*) -- when True, will include the
    zero-padding in the averaging calculation

  * **divisor_override** (*Optional**[**int**]*) -- if specified,


it will be used as divisor, otherwise size of the pooling
        region will be used.
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 \times
       \text{padding}[0] -
       \text{kernel\_size}[0]}{\text{stride}[0]} + 1\right\rfloor

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

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


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


torch.nn.functional.feature_alpha_dropout
torch.nn.functional.feature_alpha_dropout(input, p=0.5, training=False, inplace=False)
Randomly masks out entire channels (a channel is a feature map,
   e.g. the j-th channel of the i-th sample in the batch input is a
   tensor \text{input}[i, j]) of the input tensor). Instead of setting
   activations to zero, as in regular Dropout, the activations are set
   to the negative saturation value of the SELU activation function.
Each element will be masked independently on every forward call
   with probability "p" using samples from a Bernoulli distribution.
   The elements to be masked are randomized on every forward call, and
   scaled and shifted to maintain zero mean and unit variance.
See "FeatureAlphaDropout" for details.
Parameters:
      * p (float) -- dropout probability of a channel to be
        zeroed. Default: 0.5
  * **training** (*bool*) -- apply dropout if is "True". Default:


"True"
  * **inplace** (*bool*) -- If set to "True", will do this
    operation in-place. Default: "False"

Return type:
      Tensor


torch.Tensor.to_sparse_csr
Tensor.to_sparse_csr(dense_dim=None) -> Tensor
Convert a tensor to compressed row storage format (CSR).  Except
   for strided tensors, only works with 2D tensors.  If the "self" is
   strided, then the number of dense dimensions could be specified,
   and a hybrid CSR tensor will be created, with dense_dim dense
   dimensions and self.dim() - 2 - dense_dim batch dimension.
Parameters:
      dense_dim (int, optional) -- Number of dense
      dimensions of the resulting CSR tensor.  This argument should be
      used only if "self" is a strided tensor, and must be a value
      between 0 and dimension of "self" tensor minus two.
Example:
  >>> dense = torch.randn(5, 5)
  >>> sparse = dense.to_sparse_csr()
  >>> sparse._nnz()
  25

  >>> dense = torch.zeros(3, 3, 1, 1)
  >>> dense[0, 0] = dense[1, 2] = dense[2, 1] = 1
  >>> dense.to_sparse_csr(dense_dim=2)
  tensor(crow_indices=tensor([0, 1, 2, 3]),