stores all of the data that the "torch.Tensor" views.
Warning:
  All storage classes except for "torch.UntypedStorage" will be
  removed in the future, and "torch.UntypedStorage" will be used in
  all cases.
class torch.TypedStorage(args, wrap_storage=None, dtype=None, device=None, internal=False)
   bfloat16()
      Casts this storage to bfloat16 type
   bool()
      Casts this storage to bool type
   byte()
      Casts this storage to byte type
   char()
      Casts this storage to char type
   clone()
      Returns a copy of this storage
   complex_double()
      Casts this storage to complex double type
   complex_float()
      Casts this storage to complex float type
   copy(source, non_blocking=None)
   cpu()
      Returns a CPU copy of this storage if it's not already on the
      CPU
   cuda(device=None, non_blocking=False, *kwargs)
      Returns a copy of this object in CUDA memory.
      If this object is already in CUDA memory and on the correct


device, then no copy is performed and the original object is
      returned.
      Parameters:
         * device (int) -- The destination GPU id. Defaults to
           the current device.
         * non_blocking (bool) -- If "True" and the source is in
           pinned memory, the copy will be asynchronous with respect
           to the host. Otherwise, the argument has no effect.
         * *kwargs -- For compatibility, may contain the key
           "async" in place of the "non_blocking" argument.
      Return type:
         T
   data_ptr()
   property device
   double()
      Casts this storage to double type
   dtype: dtype
   element_size()
   fill_(value)
   float()
      Casts this storage to float type
   classmethod from_buffer(args, kwargs)
   classmethod from_file(filename, shared=False, size=0) -> Storage
      If shared is True, then memory is shared between all
      processes. All changes are written to the file. If shared is


False, then the changes on the storage do not affect the file.
      size is the number of elements in the storage. If shared is
      False, then the file must contain at least size *
      sizeof(Type) bytes (Type is the type of storage). If shared
      is True the file will be created if needed.
      Parameters:
         * filename (str) -- file name to map
         * shared (bool) -- whether to share memory
         * size (int) -- number of elements in the storage
   get_device()
      Return type:
         int
   half()
      Casts this storage to half type
   int()
      Casts this storage to int type
   property is_cuda
   is_pinned()
   is_shared()
   is_sparse = False
   long()
      Casts this storage to long type
   nbytes()
   pickle_storage_type()
   pin_memory()
      Coppies the  storage to pinned memory, if it's not already
      pinned.
   resize_(size)
   share_memory_()
      Moves the storage to shared memory.


Moves the storage to shared memory.
      This is a no-op for storages already in shared memory and for
      CUDA storages, which do not need to be moved for sharing across
      processes. Storages in shared memory cannot be resized.
      Returns: self
   short()
      Casts this storage to short type
   size()
   tolist()
      Returns a list containing the elements of this storage
   type(dtype=None, non_blocking=False)
      Returns the type if dtype is not provided, else casts this
      object to the specified type.
      If this is already of the correct type, no copy is performed and
      the original object is returned.
      Parameters:
         * dtype (type or string) -- The desired type
         * non_blocking (bool) -- If "True", and the source is
           in pinned memory and destination is on the GPU or vice
           versa, the copy is performed asynchronously with respect to
           the host. Otherwise, the argument has no effect.


*kwargs -- For compatibility, may contain the key
           "async" in place of the "non_blocking" argument. The
           "async" arg is deprecated.
      Return type:
         Union[T, str]
   untyped()
      Returns the internal "torch.UntypedStorage"
class torch.UntypedStorage(args, kwargs)
   bfloat16()
      Casts this storage to bfloat16 type
   bool()
      Casts this storage to bool type
   byte()
      Casts this storage to byte type
   char()
      Casts this storage to char type
   clone()
      Returns a copy of this storage
   complex_double()
      Casts this storage to complex double type
   complex_float()
      Casts this storage to complex float type
   copy_()
   cpu()
      Returns a CPU copy of this storage if it's not already on the
      CPU
   cuda(device=None, non_blocking=False, **kwargs)
      Returns a copy of this object in CUDA memory.
      If this object is already in CUDA memory and on the correct


device, then no copy is performed and the original object is
      returned.
      Parameters:
         * device (int) -- The destination GPU id. Defaults to
           the current device.
         * non_blocking (bool) -- If "True" and the source is in
           pinned memory, the copy will be asynchronous with respect
           to the host. Otherwise, the argument has no effect.
         * *kwargs -- For compatibility, may contain the key
           "async" in place of the "non_blocking" argument.
   data_ptr()
   device: device
   double()
      Casts this storage to double type
   element_size()
   fill_()
   float()
      Casts this storage to float type
   static from_buffer()
   static from_file(filename, shared=False, size=0) -> Storage
      If shared is True, then memory is shared between all
      processes. All changes are written to the file. If shared is
      False*, then the changes on the storage do not affect the file.


size is the number of elements in the storage. If shared is
      False, then the file must contain at least size *
      sizeof(Type) bytes (Type is the type of storage). If shared
      is True the file will be created if needed.
      Parameters:
         * filename (str) -- file name to map
         * shared (bool) -- whether to share memory
         * size (int) -- number of elements in the storage
   get_device()
      Return type:
         int
   half()
      Casts this storage to half type
   int()
      Casts this storage to int type
   property is_cuda
   is_pinned()
   is_shared()
   is_sparse: bool = False
   is_sparse_csr: bool = False
   long()
      Casts this storage to long type
   mps()
      Returns a CPU copy of this storage if it's not already on the
      CPU
   nbytes()
   new()
   pin_memory()
      Copies the storage to pinned memory, if it's not already pinned.
   resize_()
   share_memory_()
      Moves the storage to shared memory.


Moves the storage to shared memory.
      This is a no-op for storages already in shared memory and for
      CUDA storages, which do not need to be moved for sharing across
      processes. Storages in shared memory cannot be resized.
      Returns: self
   short()
      Casts this storage to short type
   size()
      Return type:
         int
   tolist()
      Returns a list containing the elements of this storage
   type(dtype=None, non_blocking=False, kwargs)
      Returns the type if dtype is not provided, else casts this
      object to the specified type.
      If this is already of the correct type, no copy is performed and
      the original object is returned.
      Parameters:
         * dtype (*type or string*) -- The desired type
         * non_blocking (bool) -- If "True", and the source is
           in pinned memory and destination is on the GPU or vice
           versa, the copy is performed asynchronously with respect to


the host. Otherwise, the argument has no effect.
         * *kwargs -- For compatibility, may contain the key
           "async" in place of the "non_blocking" argument. The
           "async" arg is deprecated.
   untyped()
class torch.DoubleStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.float64
class torch.FloatStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.float32
class torch.HalfStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.float16
class torch.LongStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.int64
class torch.IntStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.int32
class torch.ShortStorage(*args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.int16


dtype: dtype = torch.int16
class torch.CharStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.int8
class torch.ByteStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.uint8
class torch.BoolStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.bool
class torch.BFloat16Storage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.bfloat16
class torch.ComplexDoubleStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.complex128
class torch.ComplexFloatStorage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.complex64
class torch.QUInt8Storage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.quint8
class torch.QInt8Storage(args, wrap_storage=None, dtype=None, device=None, _internal=False)


dtype: dtype = torch.qint8
class torch.QInt32Storage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.qint32
class torch.QUInt4x2Storage(args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.quint4x2
class torch.QUInt2x4Storage(*args, wrap_storage=None, dtype=None, device=None, _internal=False)
   dtype: dtype = torch.quint2x4


torch.monitorWarning:
  This module is a prototype release, and its interfaces and
  functionality may change without warning in future PyTorch releases.
"torch.monitor" provides an interface for logging events and counters
from PyTorch.
The stat interfaces are designed to be used for tracking high level
metrics that are periodically logged out to be used for monitoring
system performance. Since the stats aggregate with a specific window
size you can log to them from critical loops with minimal performance
impact.
For more infrequent events or values such as loss, accuracy, usage
tracking the event interface can be directly used.
Event handlers can be registered to handle the events and pass them to
an external event sink.
API Reference
=============
class torch.monitor.Aggregation
      These are types of aggregations that can be used to accumulate
      stats.
   Members:
      VALUE :
         VALUE returns the last value to be added.
      MEAN :


MEAN :
         MEAN computes the arithmetic mean of all the added values.
      COUNT :
         COUNT returns the total number of added values.
      SUM :
         SUM returns the sum of the added values.
      MAX :
         MAX returns the max of the added values.
      MIN :
         MIN returns the min of the added values.
   property name
class torch.monitor.Stat
   Stat is used to compute summary statistics in a performant way over
   fixed intervals. Stat logs the statistics as an Event once every
   "window_size" duration. When the window closes the stats are logged
   via the event handlers as a "torch.monitor.Stat" event.
   "window_size" should be set to something relatively high to avoid a
   huge number of events being logged. Ex: 60s. Stat uses millisecond
   precision.
   If "max_samples" is set, the stat will cap the number of samples
   per window by discarding add calls once "max_samples" adds have
   occurred. If it's not set, all "add" calls during the window will


be included. This is an optional field to make aggregations more
   directly comparable across windows when the number of samples might
   vary.
   When the Stat is destructed it will log any remaining data even if
   the window hasn't elapsed.
   init(self: torch._C._monitor.Stat, name: str, aggregations: List[torch._C._monitor.Aggregation], window_size: datetime.timedelta, max_samples: int = 9223372036854775807) -> None
      Constructs the "Stat".
   add(self: torch._C._monitor.Stat, v: float) -> None
      Adds a value to the stat to be aggregated according to the
      configured stat type and aggregations.
   property count
      Number of data points that have currently been collected. Resets
      once the event has been logged.
   get(self: torch._C._monitor.Stat) -> Dict[torch._C._monitor.Aggregation, float]
      Returns the current value of the stat, primarily for testing
      purposes. If the stat has logged and no additional values have
      been added this will be zero.


been added this will be zero.
   property name
      The name of the stat that was set during creation.
class torch.monitor.data_value_t
   data_value_t is one of "str", "float", "int", "bool".
class torch.monitor.Event
   Event represents a specific typed event to be logged. This can
   represent high-level data points such as loss or accuracy per epoch
   or more low-level aggregations such as through the Stats provided
   through this library.
   All Events of the same type should have the same name so downstream
   handlers can correctly process them.
   init(self: torch._C._monitor.Event, name: str, timestamp: datetime.datetime, data: Dict[str, data_value_t]) -> None
      Constructs the "Event".
   property data
      The structured data contained within the "Event".
   property name
      The name of the "Event".
   property timestamp
      The timestamp when the "Event" happened.
class torch.monitor.EventHandlerHandle
   EventHandlerHandle is a wrapper type returned by


"register_event_handler" used to unregister the handler via
   "unregister_event_handler". This cannot be directly initialized.
torch.monitor.log_event(event: torch._C._monitor.Event) -> None
   log_event logs the specified event to all of the registered event
   handlers. It's up to the event handlers to log the event out to the
   corresponding event sink.
   If there are no event handlers registered this method is a no-op.
torch.monitor.register_event_handler(callback: Callable[[torch._C._monitor.Event], None]) -> torch._C._monitor.EventHandlerHandle
   register_event_handler registers a callback to be called whenever
   an event is logged via "log_event". These handlers should avoid
   blocking the main thread since that may interfere with training as
   they run during the "log_event" call.
torch.monitor.unregister_event_handler(handler: torch._C._monitor.EventHandlerHandle) -> None
   unregister_event_handler unregisters the "EventHandlerHandle"


returned after calling "register_event_handler". After this returns
   the event handler will no longer receive events.
class torch.monitor.TensorboardEventHandler(writer)
   TensorboardEventHandler is an event handler that will write known
   events to the provided SummaryWriter.
   This currently only supports "torch.monitor.Stat" events which are
   logged as scalars.
   -[ Example ]-

from torch.utils.tensorboard import SummaryWriter
from torch.monitor import TensorboardEventHandler, register_event_handler
writer = SummaryWriter("log_dir")
register_event_handler(TensorboardEventHandler(writer))
   init(writer)
      Constructs the "TensorboardEventHandler".


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.


C++Note:
  If you are looking for the PyTorch C++ API docs, directly go here.
PyTorch provides several features for working with C++, and itâs best
to choose from them based on your needs. At a high level, the
following support is available:
TorchScript C++ API
===================
TorchScript allows PyTorch models defined in Python to be serialized
and then loaded and run in C++ capturing the model code via
compilation or tracing its execution. You can learn more in the
Loading a TorchScript Model in C++ tutorial. This means you can define
your models in Python as much as possible, but subsequently export
them via TorchScript for doing no-Python execution in production or
embedded environments. The TorchScript C++ API is used to interact
with these models and the TorchScript execution engine, including:
* Loading serialized TorchScript models saved from Python
* Doing simple model modifications if needed (e.g. pulling out
  submodules)


submodules)
* Constructing the input and doing preprocessing using C++ Tensor API
Extending PyTorch and TorchScript with C++ Extensions
=====================================================
TorchScript can be augmented with user-supplied code through custom
operators and custom classes. Once registered with TorchScript, these
operators and classes can be invoked in TorchScript code run from
Python or from C++ as part of a serialized TorchScript model. The
Extending TorchScript with Custom C++ Operators tutorial walks through
interfacing TorchScript with OpenCV. In addition to wrapping a
function call with a custom operator, C++ classes and structs can be
bound into TorchScript through a pybind11-like interface which is
explained in the Extending TorchScript with Custom C++ Classes
tutorial.
Tensor and Autograd in C++
==========================
Most of the tensor and autograd operations in PyTorch Python API are
also available in the C++ API. These include:


also available in the C++ API. These include:
* "torch::Tensor" methods such as "add" / "reshape" / "clone". For the
  full list of methods available, please see:
  https://pytorch.org/cppdocs/api/classat_1_1_tensor.html
* C++ tensor indexing API that looks and behaves the same as the
  Python API. For details on its usage, please see:
  https://pytorch.org/cppdocs/notes/tensor_indexing.html
* The tensor autograd APIs and the "torch::autograd" package that are
  crucial for building dynamic neural networks in C++ frontend. For
  more details, please see:
  https://pytorch.org/tutorials/advanced/cpp_autograd.html
Authoring Models in C++
=======================
The "author in TorchScript, infer in C++" workflow requires model
authoring to be done in TorchScript. However, there might be cases
where the model has to be authored in C++ (e.g. in workflows where a
Python component is undesirable). To serve such use cases, we provide
the full capability of authoring and training a neural net model


purely in C++, with familiar components such as "torch::nn" /
"torch::nn::functional" / "torch::optim" that closely resemble the
Python API.
* For an overview of the PyTorch C++ model authoring and training API,
  please see: https://pytorch.org/cppdocs/frontend.html
* For a detailed tutorial on how to use the API, please see:
  https://pytorch.org/tutorials/advanced/cpp_frontend.html
* Docs for components such as "torch::nn" / "torch::nn::functional" /
  "torch::optim" can be found at:
  https://pytorch.org/cppdocs/api/library_root.html
Packaging for C++
=================
For guidance on how to install and link with libtorch (the library
that contains all of the above C++ APIs), please see:
https://pytorch.org/cppdocs/installing.html. Note that on Linux there
are two types of libtorch binaries provided: one compiled with GCC
pre-cxx11 ABI and the other with GCC cxx11 ABI, and you should make
the selection based on the GCC ABI your system is using.


torch.randomtorch.random.fork_rng(devices=None, enabled=True, _caller='fork_rng', _devices_kw='devices')
   Forks the RNG, so that when you return, the RNG is reset to the
   state that it was previously in.
   Parameters:
      * devices (iterable of CUDA IDs) -- CUDA devices for which
        to fork the RNG.  CPU RNG state is always forked.  By default,
        "fork_rng()" operates on all devices, but will emit a warning
        if your machine has a lot of devices, since this function will
        run very slowly in that case. If you explicitly specify
        devices, this warning will be suppressed
      * enabled (bool) -- if "False", the RNG is not forked.
        This is a convenience argument for easily disabling the
        context manager without having to delete it and unindent your
        Python code under it.
   Return type:
      Generator
torch.random.get_rng_state()
   Returns the random number generator state as a torch.ByteTensor.
   Return type:


Return type:
      Tensor
torch.random.initial_seed()
   Returns the initial seed for generating random numbers as a Python
   long.
   Return type:
      int
torch.random.manual_seed(seed)
   Sets the seed for generating random numbers. Returns a
   torch.Generator object.
   Parameters:
      seed (int) -- The desired seed. Value must be within the
      inclusive range [-0x8000_0000_0000_0000,
      0xffff_ffff_ffff_ffff]. Otherwise, a RuntimeError is raised.
      Negative inputs are remapped to positive values with the formula
      0xffff_ffff_ffff_ffff + seed.
   Return type:
      Generator
torch.random.seed()
   Sets the seed for generating random numbers to a non-deterministic
   random number. Returns a 64 bit number used to seed the RNG.
   Return type:
      int
torch.random.set_rng_state(new_state)
   Sets the random number generator state.
   Parameters:
      new_state (torch.ByteTensor) -- The desired state


AvgPool1dclass torch.nn.AvgPool1d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True)
   Applies a 1D 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, L), output (N, C, L_{out}) and "kernel_size" k can be
   precisely described as:
      \text{out}(N_i, C_j, l) = \frac{1}{k} \sum_{m=0}^{k-1}
      \text{input}(N_i, C_j, \text{stride} \times l + m)
   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 each be an
   "int" or a one-element tuple.
   Parameters:
      * kernel_size (Union[int, Tuple[int]]) --


the size of the window
      * stride (Union[int, Tuple[int]]) -- the
        stride of the window. Default value is "kernel_size"
      * padding (Union[int, Tuple[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
   Shape:
      * Input: (N, C, L_{in}) or (C, L_{in}).
      * Output: (N, C, L_{out}) or (C, L_{out}), where
           L_{out} = \left\lfloor \frac{L_{in} + 2 \times
           \text{padding} - \text{kernel_size}}{\text{stride}} +
           1\right\rfloor
   Examples:
      >>> # pool with window of size=3, stride=2
      >>> m = nn.AvgPool1d(3, stride=2)
      >>> m(torch.tensor([[[1., 2, 3, 4, 5, 6, 7]]]))
      tensor([[[2., 4., 6.]]])


torch.Tensor.tanhTensor.tanh() -> Tensor
   See "torch.tanh()"


torch.eqtorch.eq(input, other, , out=None) -> Tensor
   Computes element-wise equality
   The second argument can be a number or a tensor whose shape is
   broadcastable with the first argument.
   Parameters:
      * input (Tensor) -- the tensor to compare
      * other (Tensor or float) -- the tensor or value to
        compare
   Keyword Arguments:
      out (Tensor, optional*) -- the output tensor.
   Returns:
      A boolean tensor that is True where "input" is equal to "other"
      and False elsewhere
   Example:
      >>> torch.eq(torch.tensor([[1, 2], [3, 4]]), torch.tensor([[1, 1], [4, 4]]))
      tensor([[ True, False],
              [False, True]])


torch.floortorch.floor(input, , out=None) -> Tensor
   Returns a new tensor with the floor of the elements of "input", the
   largest integer less than or equal to each element.
   For integer inputs, follows the array-api convention of returning a
   copy of the input tensor.
      \text{out}{i} = \left\lfloor \text{input} \right\rfloor
   Parameters:
      input (Tensor) -- the input tensor.
   Keyword Arguments:
      out (Tensor, optional*) -- the output tensor.
   Example:
      >>> a = torch.randn(4)
      >>> a
      tensor([-0.8166,  1.5308, -0.2530, -0.2091])
      >>> torch.floor(a)
      tensor([-1.,  1., -1., -1.])


torch.autograd.Function.jvpstatic Function.jvp(ctx, grad_inputs)
   Defines a formula for differentiating the operation with forward
   mode automatic differentiation. This function is to be overridden
   by all subclasses. It must accept a context "ctx" as the first
   argument, followed by as many inputs as the "forward()" got (None
   will be passed in for non tensor inputs of the forward function),
   and it should return as many tensors as there were outputs to
   "forward()". Each argument is the gradient w.r.t the given input,
   and each returned value should be the gradient w.r.t. the
   corresponding output. If an output is not a Tensor or the function
   is not differentiable with respect to that output, you can just
   pass None as a gradient for that input.
   You can use the "ctx" object to pass any value from the forward to
   this functions.
   Return type:
      Any*


ConvReLU3dclass torch.ao.nn.intrinsic.quantized.ConvReLU3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
   A ConvReLU3d module is a fused module of Conv3d and ReLU
   We adopt the same interface as "torch.ao.nn.quantized.Conv3d".
   Attributes: Same as torch.ao.nn.quantized.Conv3d


torch.Tensor.corrcoefTensor.corrcoef() -> Tensor
   See "torch.corrcoef()"


torch.Tensor.tolistTensor.tolist() -> list or number
   Returns the tensor as a (nested) list. For scalars, a standard
   Python number is returned, just like with "item()". Tensors are
   automatically moved to the CPU first if necessary.
   This operation is not differentiable.
   Examples:
      >>> a = torch.randn(2, 2)
      >>> a.tolist()
      [[0.012766935862600803, 0.5415473580360413],
       [-0.08909505605697632, 0.7729271650314331]]
      >>> a[0,0].tolist()
      0.012766935862600803


torch.autograd.gradgradchecktorch.autograd.gradgradcheck(func, inputs, grad_outputs=None, *, eps=1e-06, atol=1e-05, rtol=0.001, gen_non_contig_grad_outputs=False, raise_exception=True, nondet_tol=0.0, check_undefined_grad=True, check_grad_dtypes=False, check_batched_grad=False, check_fwd_over_rev=False, check_rev_over_rev=True, fast_mode=False)
   Check gradients of gradients computed via small finite differences
   against analytical gradients w.r.t. tensors in "inputs" and
   "grad_outputs" that are of floating point or complex type and with
   "requires_grad=True".
   This function checks that backpropagating through the gradients
   computed to the given "grad_outputs" are correct.
   The check between numerical and analytical gradients uses
   "allclose()".
   Note:
     The default values are designed for "input" and "grad_outputs" of
     double precision. This check will likely fail if they are of less
     precision, e.g., "FloatTensor".
   Warning:


precision, e.g., "FloatTensor".
   Warning:
     If any checked tensor in "input" and "grad_outputs" has
     overlapping memory, i.e., different indices pointing to the same
     memory address (e.g., from "torch.expand()"), this check will
     likely fail because the numerical gradients computed by point
     perturbation at such indices will change values at all other
     indices that share the same memory address.
   Parameters:
      * func (function) -- a Python function that takes Tensor
        inputs and returns a Tensor or a tuple of Tensors
      * inputs (tuple of Tensor or Tensor) -- inputs to the
        function
      * grad_outputs (tuple of Tensor or Tensor,
        optional) -- The gradients with respect to the function's
        outputs.
      * eps (float, optional) -- perturbation for finite
        differences
      * atol (float, optional) -- absolute tolerance
      * rtol (float, optional) -- relative tolerance


gen_non_contig_grad_outputs (bool, optional) -- if
        "grad_outputs" is "None" and "gen_non_contig_grad_outputs" is
        "True", the randomly generated gradient outputs are made to be
        noncontiguous
raise_exception (bool, optional) -- indicating
    whether to raise an exception if the check fails. The
    exception gives more information about the exact nature of the
    failure. This is helpful when debugging gradchecks.
nondet_tol (float, optional) -- tolerance for non-
    determinism. When running identical inputs through the
    differentiation, the results must either match exactly
    (default, 0.0) or be within this tolerance. Note that a small
    amount of nondeterminism in the gradient will lead to larger
    inaccuracies in the second derivative.
check_undefined_grad (bool, optional) -- if True,
    check if undefined output grads are supported and treated as
    zeros


zeros
      * check_batched_grad (bool, optional) -- if True,
        check if we can compute batched gradients using prototype vmap
        support. Defaults to False.
      * fast_mode (bool, optional) -- if True, run a faster
        implementation of gradgradcheck that no longer computes the
        entire jacobian.
   Returns:
      True if all differences satisfy allclose condition
   Return type:
      bool


torch.Tensor.bmmTensor.bmm(batch2) -> Tensor
   See "torch.bmm()"


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


torch.jit.tracetorch.jit.trace(func, example_inputs=None, optimize=None, check_trace=True, check_inputs=None, check_tolerance=1e-05, strict=True, _force_outplace=False, _module_class=None, _compilation_unit=, example_kwarg_inputs=None)
   Trace a function and return an executable  or "ScriptFunction" that
   will be optimized using just-in-time compilation. Tracing is ideal
   for code that operates only on "Tensor"s and lists, dictionaries,
   and tuples of "Tensor"s.
   Using torch.jit.trace and torch.jit.trace_module, you can turn
   an existing module or Python function into a TorchScript
   "ScriptFunction" or "ScriptModule". You must provide example
   inputs, and we run the function, recording the operations performed
   on all the tensors.
   * The resulting recording of a standalone function produces
     ScriptFunction.
   * The resulting recording of nn.Module.forward or nn.Module
     produces ScriptModule.


produces ScriptModule.
   This module also contains any parameters that the original module
   had as well.
   Warning:
     Tracing only correctly records functions and modules which are
     not data dependent (e.g., do not have conditionals on data in
     tensors) and do not have any untracked external dependencies
     (e.g., perform input/output or access global variables). Tracing
     only records operations done when the given function is run on
     the given tensors. Therefore, the returned ScriptModule will
     always run the same traced graph on any input. This has some
     important implications when your module is expected to run
     different sets of operations, depending on the input and/or the
     module state. For example,
     * Tracing will not record any control-flow like if-statements or
       loops. When this control-flow is constant across your module,
       this is fine and it often inlines the control-flow decisions.


But sometimes the control-flow is actually part of the model
       itself. For instance, a recurrent network is a loop over the
       (possibly dynamic) length of an input sequence.
     * In the returned "ScriptModule", operations that have different
       behaviors in "training" and "eval" modes will always behave as
       if it is in the mode it was in during tracing, no matter which
       mode the ScriptModule is in.
     In cases like these, tracing would not be appropriate and
     "scripting" is a better choice. If you trace such models, you may
     silently get incorrect results on subsequent invocations of the
     model. The tracer will try to emit warnings when doing something
     that may cause an incorrect trace to be produced.
   Parameters:
      func (callable or torch.nn.Module) -- A Python
      function or torch.nn.Module that will be run with
      example_inputs. func arguments and return values  must be


tensors or (possibly nested) tuples that contain tensors. When a
      module is passed torch.jit.trace, only the "forward" method is
      run and traced (see "torch.jit.trace" for details).
   Keyword Arguments:
      * example_inputs (tuple or torch.Tensor or None,
        optional) -- A tuple of example inputs that will be passed
        to the function while tracing. Default: "None". Either this
        argument or "example_kwarg_inputs" should be specified. The
        resulting trace can be run with inputs of different types and
        shapes assuming the traced operations support those types and
        shapes. example_inputs may also be a single Tensor in which
        case it is automatically wrapped in a tuple. When the value is
        None, "example_kwarg_inputs" should be specified.
      * check_trace ("bool", optional) -- Check if the same inputs
        run through traced code produce the same outputs. Default:


"True". You might want to disable this if, for example, your
        network contains non- deterministic ops or if you are sure
        that the network is correct despite a checker failure.
      * check_inputs (list of tuples, optional) -- A list of
        tuples of input arguments that should be used to check the
        trace against what is expected. Each tuple is equivalent to a
        set of input arguments that would be specified in
        "example_inputs". For best results, pass in a set of checking
        inputs representative of the space of shapes and types of
        inputs you expect the network to see.  If not specified, the
        original "example_inputs" are used for checking
      * check_tolerance (float, optional) -- Floating-point
        comparison tolerance to use in the checker procedure.  This
        can be used to relax the checker strictness in the event that
        results diverge numerically for a known reason, such as
        operator fusion.


operator fusion.
      * strict ("bool", optional) -- run the tracer in a strict
        mode or not (default: "True"). Only turn this off when you
        want the tracer to record your mutable container types
        (currently "list"/"dict") and you are sure that the container
        you are using in your problem is a "constant" structure and
        does not get used as control flow (if, for) conditions.
      * example_kwarg_inputs (dict, optional) -- This
        parameter is a pack of keyword arguments of example inputs
        that will be passed to the function while tracing. Default:
        "None". Either this argument or "example_inputs" should be
        specified. The dict will be unpacking by the arguments name of
        the traced function. If the keys of the dict don't not match
        with the traced function's arguments name, a runtime exception
        will be raised.
   Returns:
      If func is nn.Module or "forward" of nn.Module, trace


returns a "ScriptModule" object with a single "forward" method
      containing the traced code.  The returned ScriptModule will
      have the same set of sub-modules and parameters as the original
      "nn.Module".  If "func" is a standalone function, "trace"
      returns ScriptFunction.
   Example (tracing a function):
      import torch
      def foo(x, y):
          return 2 * x + y
      # Run foo with the provided inputs and record the tensor operations
      traced_foo = torch.jit.trace(foo, (torch.rand(3), torch.rand(3)))
      # traced_foo can now be run with the TorchScript interpreter or saved
      # and loaded in a Python-free environment
   Example (tracing an existing module):
      import torch
      import torch.nn as nn
      class Net(nn.Module):
          def init(self):
              super(Net, self).init()
              self.conv = nn.Conv2d(1, 1, 3)
          def forward(self, x):
              return self.conv(x)
      n = Net()


return self.conv(x)
      n = Net()
      example_weight = torch.rand(1, 1, 3, 3)
      example_forward_input = torch.rand(1, 1, 3, 3)
      # Trace a specific method and construct ScriptModule with
      # a single forward method
      module = torch.jit.trace(n.forward, example_forward_input)
      # Trace a module (implicitly traces forward) and construct a
      # ScriptModule with a single forward method
      module = torch.jit.trace(n, example_forward_input)


Unflattenclass torch.nn.Unflatten(dim, unflattened_size)
   Unflattens a tensor dim expanding it to a desired shape. For use
   with "Sequential".
   * "dim" specifies the dimension of the input tensor to be
     unflattened, and it can be either int or str when Tensor or
     NamedTensor is used, respectively.
   * "unflattened_size" is the new shape of the unflattened dimension
     of the tensor and it can be a tuple of ints or a list of ints
     or torch.Size for Tensor input;  a NamedShape (tuple of
     (name, size) tuples) for NamedTensor input.
   Shape:
      * Input: (, S_{\text{dim}}, ), where S_{\text{dim}} is the
        size at dimension "dim" and * means any number of dimensions
        including none.
      * Output: (, U_1, ..., U_n, ), where U = "unflattened_size"
        and \prod_{i=1}^n U_i = S_{\text{dim}}.
   Parameters:
      * dim (Union[int, str]) -- Dimension to be
        unflattened


unflattened
      * unflattened_size (Union[torch.Size, Tuple,
        List, NamedShape]) -- New shape of the unflattened
        dimension
   -[ Examples ]-

input = torch.randn(2, 50)
With tuple of ints
m = nn.Sequential(
    nn.Linear(50, 50),
    nn.Unflatten(1, (2, 5, 5))
)
output = m(input)
output.size()
   torch.Size([2, 2, 5, 5])
With torch.Size
m = nn.Sequential(
    nn.Linear(50, 50),
    nn.Unflatten(1, torch.Size([2, 5, 5]))
)
output = m(input)
output.size()
   torch.Size([2, 2, 5, 5])
With namedshape (tuple of tuples)
input = torch.randn(2, 50, names=('N', 'features'))
unflatten = nn.Unflatten('features', (('C', 2), ('H', 5), ('W', 5)))
output = unflatten(input)
output.size()
   torch.Size([2, 2, 5, 5])


torch.Tensor.coalesceTensor.coalesce() -> Tensor
   Returns a coalesced copy of "self" if "self" is an uncoalesced
   tensor.
   Returns "self" if "self" is a coalesced tensor.
   Warning:
     Throws an error if "self" is not a sparse COO tensor.


torch.outertorch.outer(input, vec2, , out=None) -> Tensor
   Outer product of "input" and "vec2". If "input" is a vector of size
   n and "vec2" is a vector of size m, then "out" must be a matrix of
   size (n \times m).
   Note:
     This function does not broadcast.
   Parameters:
      * input (Tensor) -- 1-D input vector
      * vec2 (Tensor) -- 1-D input vector
   Keyword Arguments:
      out (Tensor, optional*) -- optional output matrix
   Example:
      >>> v1 = torch.arange(1., 5.)
      >>> v2 = torch.arange(1., 4.)
      >>> torch.outer(v1, v2)
      tensor([[  1.,   2.,   3.],
              [  2.,   4.,   6.],
              [  3.,   6.,   9.],
              [  4.,   8.,  12.]])


torch.nn.functional.avg_pool3dtorch.nn.functional.avg_pool3d(input, kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) -> Tensor
   Applies 3D average-pooling operation in kT \times kH \times kW
   regions by step size sT \times sH \times sW steps. The number of
   output features is equal to \lfloor\frac{\text{input
   planes}}{sT}\rfloor.
   See "AvgPool3d" for details and output shape.
   Parameters:
      * input -- input tensor (\text{minibatch} ,
        \text{in_channels} , iT \times iH , iW)
      * kernel_size -- size of the pooling region. Can be a single
        number or a tuple (kT, kH, kW)
      * stride -- stride of the pooling operation. Can be a single
        number or a tuple (sT, sH, sW). Default: "kernel_size"
      * padding -- implicit zero paddings on both sides of the
        input. Can be a single number or a tuple (padT, padH, padW),
        Default: 0


Default: 0
      * ceil_mode -- when True, will use ceil instead of floor
        in the formula to compute the output shape
      * count_include_pad -- when True, will include the zero-
        padding in the averaging calculation
      * divisor_override -- if specified, it will be used as
        divisor, otherwise size of the pooling region will be used.
        Default: None


torch.autograd.graph.Node.next_functionsabstract property Node.next_functions: Tuple[Tuple[Optional[Node], int], ...]


torch.Tensor.byteTensor.byte(memory_format=torch.preserve_format) -> Tensor
   "self.byte()" is equivalent to "self.to(torch.uint8)". See "to()".
   Parameters:
      memory_format ("torch.memory_format", optional) -- the
      desired memory format of returned Tensor. Default:
      "torch.preserve_format".


LinearReLUclass torch.ao.nn.intrinsic.quantized.dynamic.LinearReLU(in_features, out_features, bias=True, dtype=torch.qint8)
   A LinearReLU module fused from Linear and ReLU modules that can be
   used for dynamic quantization. Supports both, FP16 and INT8
   quantization.
   We adopt the same interface as
   "torch.ao.nn.quantized.dynamic.Linear".
   Variables:
      torch.ao.nn.quantized.dynamic.Linear (Same as) --
   Examples:
      >>> m = nn.intrinsic.quantized.dynamic.LinearReLU(20, 30)
      >>> input = torch.randn(128, 20)
      >>> output = m(input)
      >>> print(output.size())
      torch.Size([128, 30])


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


MaxUnpool1dclass torch.nn.MaxUnpool1d(kernel_size, stride=None, padding=0)
   Computes a partial inverse of "MaxPool1d".
   "MaxPool1d" is not fully invertible, since the non-maximal values
   are lost.
   "MaxUnpool1d" takes in as input the output of "MaxPool1d" including
   the indices of the maximal values and computes a partial inverse in
   which all non-maximal values are set to zero.
   Note:
     "MaxPool1d" can map several input sizes to the same output sizes.
     Hence, the inversion process can get ambiguous. To accommodate
     this, you can provide the needed output size as an additional
     argument "output_size" in the forward call. See the Inputs and
     Example below.
   Parameters:
      * kernel_size (int or tuple) -- Size of the max
        pooling window.
      * stride (int or tuple) -- Stride of the max pooling
        window. It is set to "kernel_size" by default.
      * padding (int or tuple) -- Padding that was added to
        the input


the input
   Inputs:
      * input: the input Tensor to invert
      * indices: the indices given out by "MaxPool1d"
      * output_size (optional): the targeted output size
   Shape:
      * Input: (N, C, H_{in}) or (C, H_{in}).
      * Output: (N, C, H_{out}) or (C, H_{out}), where
           H_{out} = (H_{in} - 1) \times \text{stride}[0] - 2 \times
           \text{padding}[0] + \text{kernel_size}[0]
        or as given by "output_size" in the call operator
   Example:
      >>> pool = nn.MaxPool1d(2, stride=2, return_indices=True)
      >>> unpool = nn.MaxUnpool1d(2, stride=2)
      >>> input = torch.tensor([[[1., 2, 3, 4, 5, 6, 7, 8]]])
      >>> output, indices = pool(input)
      >>> unpool(output, indices)
      tensor([[[ 0.,  2.,  0.,  4.,  0.,  6.,  0., 8.]]])
      >>> # Example showcasing the use of output_size
      >>> input = torch.tensor([[[1., 2, 3, 4, 5, 6, 7, 8, 9]]])
      >>> output, indices = pool(input)
      >>> unpool(output, indices, output_size=input.size())


tensor([[[ 0.,  2.,  0.,  4.,  0.,  6.,  0., 8.,  0.]]])
      >>> unpool(output, indices)
      tensor([[[ 0.,  2.,  0.,  4.,  0.,  6.,  0., 8.]]])


torch.Tensor.argmaxTensor.argmax(dim=None, keepdim=False) -> LongTensor
   See "torch.argmax()"


torch.nn.functional.max_pool2dtorch.nn.functional.max_pool2d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
   Applies a 2D max pooling over an input signal composed of several
   input planes.
   Note:
     The order of "ceil_mode" and "return_indices" is different from
     what seen in "MaxPool2d", and will change in a future release.
   See "MaxPool2d" for details.
   Parameters:
      * input -- input tensor (\text{minibatch} ,
        \text{in_channels} , iH , iW), minibatch dim optional.
      * kernel_size -- size of the pooling region. Can be a single
        number or a tuple (kH, kW)
      * stride -- stride of the pooling operation. Can be a single
        number or a tuple (sH, sW). Default: "kernel_size"
      * padding -- Implicit negative infinity padding to be added
        on both sides, must be >= 0 and <= kernel_size / 2.
      * dilation -- The stride between elements within a sliding


window, must be > 0.
      * ceil_mode -- If "True", will use ceil instead of floor
        to compute the output shape. This ensures that every element
        in the input tensor is covered by a sliding window.
      * return_indices -- If "True", will return the argmax along
        with the max values. Useful for
        "torch.nn.functional.max_unpool2d" later


torch.Tensor.unsqueeze_Tensor.unsqueeze_(dim) -> Tensor
   In-place version of "unsqueeze()"


QFunctionalclass torch.ao.nn.quantized.QFunctional
   Wrapper class for quantized operations.
   The instance of this class can be used instead of the
   "torch.ops.quantized" prefix. See example usage below.
   Note:
     This class does not provide a "forward" hook. Instead, you must
     use one of the underlying functions (e.g. "add").
   Examples:
      >>> q_add = QFunctional()
      >>> a = torch.quantize_per_tensor(torch.tensor(3.0), 1.0, 0, torch.qint32)
      >>> b = torch.quantize_per_tensor(torch.tensor(4.0), 1.0, 0, torch.qint32)
      >>> q_add.add(a, b)  # Equivalent to torch.ops.quantized.add(a, b, 1.0, 0)
   Valid operation names:
      * add
      * cat
      * mul
      * add_relu
      * add_scalar
      * mul_scalar


LazyBatchNorm1dclass torch.nn.LazyBatchNorm1d(eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)
   A "torch.nn.BatchNorm1d" module with lazy initialization of the
   "num_features" argument of the "BatchNorm1d" that is inferred from
   the "input.size(1)". The attributes that will be lazily initialized
   are weight, bias, running_mean and running_var.
   Check the "torch.nn.modules.lazy.LazyModuleMixin" for further
   documentation on lazy modules and their limitations.
   Parameters:
      * eps (float) -- a value added to the denominator for
        numerical stability. Default: 1e-5
      * momentum (float) -- the value used for the running_mean
        and running_var computation. Can be set to "None" for
        cumulative moving average (i.e. simple average). Default: 0.1
      * affine (bool) -- a boolean value that when set to
        "True", this module has learnable affine parameters. Default:
        "True"


"True"
      * track_running_stats (bool) -- a boolean value that when
        set to "True", this module tracks the running mean and
        variance, and when set to "False", this module does not track
        such statistics, and initializes statistics buffers
        "running_mean" and "running_var" as "None". When these buffers
        are "None", this module always uses batch statistics. in both
        training and eval modes. Default: "True"
   cls_to_become
      alias of "BatchNorm1d"


torch.fliplrtorch.fliplr(input) -> Tensor
   Flip tensor in the left/right direction, returning a new tensor.
   Flip the entries in each row in the left/right direction. Columns
   are preserved, but appear in a different order than before.
   Note:
     Requires the tensor to be at least 2-D.
   Note:
     torch.fliplr makes a copy of "input"'s data. This is different
     from NumPy's np.fliplr, which returns a view in constant time.
     Since copying a tensor's data is more work than viewing that
     data, torch.fliplr is expected to be slower than np.fliplr.
   Parameters:
      input (Tensor) -- Must be at least 2-dimensional.
   Example:
      >>> x = torch.arange(4).view(2, 2)
      >>> x
      tensor([[0, 1],
              [2, 3]])
      >>> torch.fliplr(x)
      tensor([[1, 0],
              [3, 2]])


EmbeddingBagclass torch.nn.EmbeddingBag(num_embeddings, embedding_dim, max_norm=None, norm_type=2.0, scale_grad_by_freq=False, mode='mean', sparse=False, _weight=None, include_last_offset=False, padding_idx=None, device=None, dtype=None)
   Computes sums or means of 'bags' of embeddings, without
   instantiating the intermediate embeddings.
   For bags of constant length, no "per_sample_weights", no indices
   equal to "padding_idx", and with 2D inputs, this class
      * with "mode="sum"" is equivalent to "Embedding" followed by
        "torch.sum(dim=1)",
      * with "mode="mean"" is equivalent to "Embedding" followed by
        "torch.mean(dim=1)",
      * with "mode="max"" is equivalent to "Embedding" followed by
        "torch.max(dim=1)".
   However, "EmbeddingBag" is much more time and memory efficient than
   using a chain of these operations.
   EmbeddingBag also supports per-sample weights as an argument to the
   forward pass. This scales the output of the Embedding before


performing a weighted reduction as specified by "mode". If
   "per_sample_weights" is passed, the only supported "mode" is
   ""sum"", which computes a weighted sum according to
   "per_sample_weights".
   Parameters:
      * num_embeddings (int) -- size of the dictionary of
        embeddings
      * embedding_dim (int) -- the size of each embedding vector
      * max_norm (float, optional) -- If given, each
        embedding vector with norm larger than "max_norm" is
        renormalized to have norm "max_norm".
      * norm_type (float, optional) -- The p of the p-norm
        to compute for the "max_norm" option. Default "2".
      * scale_grad_by_freq (bool, optional) -- if given,
        this will scale gradients by the inverse of frequency of the
        words in the mini-batch. Default "False". Note: this option is
        not supported when "mode="max"".
      * mode (str, optional) -- ""sum"", ""mean"" or


""max"". Specifies the way to reduce the bag. ""sum"" computes
        the weighted sum, taking "per_sample_weights" into
        consideration. ""mean"" computes the average of the values in
        the bag, ""max"" computes the max value over each bag.
        Default: ""mean""
      * sparse (bool, optional) -- if "True", gradient
        w.r.t. "weight" matrix will be a sparse tensor. See Notes for
        more details regarding sparse gradients. Note: this option is
        not supported when "mode="max"".
      * include_last_offset (bool, optional) -- if "True",
        "offsets" has one additional element, where the last element
        is equivalent to the size of indices. This matches the CSR
        format.
      * padding_idx (int, optional) -- If specified, the
        entries at "padding_idx" do not contribute to the gradient;
        therefore, the embedding vector at "padding_idx" is not


updated during training, i.e. it remains as a fixed "pad". For
        a newly constructed EmbeddingBag, the embedding vector at
        "padding_idx" will default to all zeros, but can be updated to
        another value to be used as the padding vector. Note that the
        embedding vector at "padding_idx" is excluded from the
        reduction.
   Variables:
      weight (Tensor) -- the learnable weights of the module of
      shape (num_embeddings, embedding_dim) initialized from
      \mathcal{N}(0, 1).
   Examples:
      >>> # an EmbeddingBag module containing 10 tensors of size 3
      >>> embedding_sum = nn.EmbeddingBag(10, 3, mode='sum')
      >>> # a batch of 2 samples of 4 indices each
      >>> input = torch.tensor([1, 2, 4, 5, 4, 3, 2, 9], dtype=torch.long)
      >>> offsets = torch.tensor([0, 4], dtype=torch.long)
      >>> embedding_sum(input, offsets)
      tensor([[-0.8861, -5.4350, -0.0523],
              [ 1.1306, -2.5798, -1.0044]])
      >>> # Example with padding_idx


Example with padding_idx
  >>> embedding_sum = nn.EmbeddingBag(10, 3, mode='sum', padding_idx=2)
  >>> input = torch.tensor([2, 2, 2, 2, 4, 3, 2, 9], dtype=torch.long)
  >>> offsets = torch.tensor([0, 4], dtype=torch.long)
  >>> embedding_sum(input, offsets)
  tensor([[ 0.0000,  0.0000,  0.0000],
          [-0.7082,  3.2145, -2.6251]])
  >>> # An EmbeddingBag can be loaded from an Embedding like so
  >>> embedding = nn.Embedding(10, 3, padding_idx=2)
  >>> embedding_sum = nn.EmbeddingBag.from_pretrained(
          embedding.weight,
          padding_idx=embedding.padding_idx,
          mode='sum')

forward(input, offsets=None, per_sample_weights=None)
      Forward pass of EmbeddingBag.
      Parameters:
         * input (Tensor) -- Tensor containing bags of indices
           into the embedding matrix.
         * offsets (Tensor, optional) -- Only used when
           "input" is 1D. "offsets" determines the starting index


position of each bag (sequence) in "input".
         * per_sample_weights (Tensor, optional) -- a tensor
           of float / double weights, or None to indicate all weights
           should be taken to be "1". If specified,
           "per_sample_weights" must have exactly the same shape as
           input and is treated as having the same "offsets", if those
           are not "None". Only supported for "mode='sum'".
      Returns:
         Tensor output shape of (B, embedding_dim).
      Return type:
         Tensor
      Note:
        A few notes about "input" and "offsets":
        * "input" and "offsets" have to be of the same type, either
          int or long
        * If "input" is 2D of shape (B, N), it will be treated as
          "B" bags (sequences) each of fixed length "N", and this will
          return "B" values aggregated in a way depending on the
          "mode". "offsets" is ignored and required to be "None" in
          this case.


this case.
        * If "input" is 1D of shape (N), it will be treated as a
          concatenation of multiple bags (sequences).  "offsets" is
          required to be a 1D tensor containing the starting index
          positions of each bag in "input". Therefore, for "offsets"
          of shape (B), "input" will be viewed as having "B" bags.
          Empty bags (i.e., having 0-length) will have returned
          vectors filled by zeros.
   classmethod from_pretrained(embeddings, freeze=True, max_norm=None, norm_type=2.0, scale_grad_by_freq=False, mode='mean', sparse=False, include_last_offset=False, padding_idx=None)
      Creates EmbeddingBag instance from given 2-dimensional
      FloatTensor.
      Parameters:
         * embeddings (Tensor) -- FloatTensor containing weights
           for the EmbeddingBag. First dimension is being passed to
           EmbeddingBag as 'num_embeddings', second as
           'embedding_dim'.


'embedding_dim'.
         * freeze (bool, optional) -- If "True", the tensor
           does not get updated in the learning process. Equivalent to
           "embeddingbag.weight.requires_grad = False". Default:
           "True"
         * max_norm (float, optional) -- See module
           initialization documentation. Default: "None"
         * norm_type (float, optional) -- See module
           initialization documentation. Default "2".
         * scale_grad_by_freq (bool, optional) -- See module
           initialization documentation. Default "False".
         * mode (str, optional) -- See module initialization
           documentation. Default: ""mean""
         * sparse (bool, optional) -- See module
           initialization documentation. Default: "False".
         * include_last_offset (bool, optional) -- See
           module initialization documentation. Default: "False".


padding_idx (int, optional) -- See module
           initialization documentation. Default: "None".
      Return type:
         EmbeddingBag
      Examples:
         >>> # FloatTensor containing pretrained weights
         >>> weight = torch.FloatTensor([[1, 2.3, 3], [4, 5.1, 6.3]])
         >>> embeddingbag = nn.EmbeddingBag.from_pretrained(weight)
         >>> # Get embeddings for index 1
         >>> input = torch.LongTensor([[1, 0]])
         >>> embeddingbag(input)
         tensor([[ 2.5000,  3.7000,  4.6500]])


default_float_qparams_observertorch.quantization.observer.default_float_qparams_observer
   alias of functools.partial(,
   dtype=torch.quint8, qscheme=torch.per_channel_affine_float_qparams,
   ch_axis=0){}


torch.Tensor.retains_gradTensor.retains_grad
   Is "True" if this Tensor is non-leaf and its "grad" is enabled to
   be populated during "backward()", "False" otherwise.


torch.Tensor.index_copy_Tensor.index_copy_(dim, index, tensor) -> Tensor
   Copies the elements of "tensor" into the "self" tensor by selecting
   the indices in the order given in "index". For example, if "dim ==
   0" and "index[i] == j", then the "i"th row of "tensor" is copied to
   the "j"th row of "self".
   The "dim"th dimension of "tensor" must have the same size as the
   length of "index" (which must be a vector), and all other
   dimensions must match "self", or an error will be raised.
   Note:
     If "index" contains duplicate entries, multiple elements from
     "tensor" will be copied to the same index of "self". The result
     is nondeterministic since it depends on which copy occurs last.
   Parameters:
      * dim (int) -- dimension along which to index
      * index (LongTensor) -- indices of "tensor" to select from
      * tensor (Tensor) -- the tensor containing values to copy
   Example:
      >>> x = torch.zeros(5, 3)


Example:
      >>> x = torch.zeros(5, 3)
      >>> t = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=torch.float)
      >>> index = torch.tensor([0, 4, 2])
      >>> x.index_copy_(0, index, t)
      tensor([[ 1.,  2.,  3.],
              [ 0.,  0.,  0.],
              [ 7.,  8.,  9.],
              [ 0.,  0.,  0.],
              [ 4.,  5.,  6.]])


torch.Tensor.vsplitTensor.vsplit(split_size_or_sections) -> List of Tensors
   See "torch.vsplit()"


MultiheadAttentionclass torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None)
   Allows the model to jointly attend to information from different
   representation subspaces as described in the paper: Attention Is
   All You Need.
   Multi-Head Attention is defined as:
      \text{MultiHead}(Q, K, V) =
      \text{Concat}(head_1,\dots,head_h)W^O
   where head_i = \text{Attention}(QW_i^Q, KW_i^K, VW_i^V).
   "forward()" will use a special optimized implementation if all of
   the following conditions are met:
   * self attention is being computed (i.e., "query", "key", and
     "value" are the same tensor. This restriction will be loosened in
     the future.)
   * inputs are batched (3D) with "batch_first==True"
   * Either autograd is disabled (using "torch.inference_mode" or
     "torch.no_grad") or no tensor argument "requires_grad"


training is disabled (using ".eval()")
"add_bias_kv" is "False"
"add_zero_attn" is "False"
"batch_first" is "True" and the input is batched
"kdim" and "vdim" are equal to "embed_dim"
if a NestedTensor is passed, neither "key_padding_mask" nor
     "attn_mask" is passed
autocast is disabled
   If the optimized implementation is in use, a NestedTensor can be
   passed for "query"/"key"/"value" to represent padding more
   efficiently than using a padding mask. In this case, a NestedTensor
   will be returned, and an additional speedup proportional to the
   fraction of the input that is padding can be expected.
   Parameters:
embed_dim -- Total dimension of the model.
num_heads -- Number of parallel attention heads. Note that
    "embed_dim" will be split across "num_heads" (i.e. each head
    will have dimension "embed_dim // num_heads").
dropout -- Dropout probability on "attn_output_weights".
    Default: "0.0" (no dropout).


Default: "0.0" (no dropout).
      * bias -- If specified, adds bias to input / output
        projection layers. Default: "True".
      * add_bias_kv -- If specified, adds bias to the key and
        value sequences at dim=0. Default: "False".
      * add_zero_attn -- If specified, adds a new batch of zeros
        to the key and value sequences at dim=1. Default: "False".
      * kdim -- Total number of features for keys. Default: "None"
        (uses "kdim=embed_dim").
      * vdim -- Total number of features for values. Default:
        "None" (uses "vdim=embed_dim").
      * batch_first -- If "True", then the input and output
        tensors are provided as (batch, seq, feature). Default:
        "False" (seq, batch, feature).
   Examples:
      >>> multihead_attn = nn.MultiheadAttention(embed_dim, num_heads)
      >>> attn_output, attn_output_weights = multihead_attn(query, key, value)


forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None, average_attn_weights=True, is_causal=False)
      Parameters:
         * query (Tensor) -- Query embeddings of shape (L, E_q)
           for unbatched input, (L, N, E_q) when "batch_first=False"
           or (N, L, E_q) when "batch_first=True", where L is the
           target sequence length, N is the batch size, and E_q is the
           query embedding dimension "embed_dim". Queries are compared
           against key-value pairs to produce the output. See
           "Attention Is All You Need" for more details.
         * key (Tensor) -- Key embeddings of shape (S, E_k) for
           unbatched input, (S, N, E_k) when "batch_first=False" or
           (N, S, E_k) when "batch_first=True", where S is the source
           sequence length, N is the batch size, and E_k is the key
           embedding dimension "kdim". See "Attention Is All You Need"
           for more details.


for more details.
         * value (Tensor) -- Value embeddings of shape (S, E_v)
           for unbatched input, (S, N, E_v) when "batch_first=False"
           or (N, S, E_v) when "batch_first=True", where S is the
           source sequence length, N is the batch size, and E_v is the
           value embedding dimension "vdim". See "Attention Is All You
           Need" for more details.
         * key_padding_mask (Optional[Tensor]) -- If
           specified, a mask of shape (N, S) indicating which elements
           within "key" to ignore for the purpose of attention (i.e.
           treat as "padding"). For unbatched query, shape should be
           (S). Binary and byte masks are supported. For a binary
           mask, a "True" value indicates that the corresponding "key"
           value will be ignored for the purpose of attention. For a
           float mask, it will be directly added to the corresponding
           "key" value.


"key" value.
         * need_weights (bool) -- If specified, returns
           "attn_output_weights" in addition to "attn_outputs".
           Default: "True".
         * attn_mask (Optional[Tensor]) -- If specified, a
           2D or 3D mask preventing attention to certain positions.
           Must be of shape (L, S) or (N\cdot\text{num_heads}, L, S),
           where N is the batch size, L is the target sequence length,
           and S is the source sequence length. A 2D mask will be
           broadcasted across the batch while a 3D mask allows for a
           different mask for each entry in the batch. Binary, byte,
           and float masks are supported. For a binary mask, a "True"
           value indicates that the corresponding position is not
           allowed to attend. For a byte mask, a non-zero value
           indicates that the corresponding position is not allowed to
           attend. For a float mask, the mask values will be added to


the attention weight.
         * is_causal (bool) -- If specified, applies a causal
           mask as attention mask. Mutually exclusive with providing
           attn_mask. Default: "False".
         * average_attn_weights (bool) -- If true, indicates
           that the returned "attn_weights" should be averaged across
           heads. Otherwise, "attn_weights" are provided separately
           per head. Note that this flag only has an effect when
           "need_weights=True". Default: "True" (i.e. average weights
           across heads)
      Return type:
         Tuple[Tensor, Optional[Tensor]]
      Outputs:
         * attn_output - Attention outputs of shape (L, E) when
           input is unbatched, (L, N, E) when "batch_first=False" or
           (N, L, E) when "batch_first=True", where L is the target
           sequence length, N is the batch size, and E is the
           embedding dimension "embed_dim".
         * attn_output_weights - Only returned when


"need_weights=True". If "average_attn_weights=True",
           returns attention weights averaged across heads of shape
           (L, S) when input is unbatched or (N, L, S), where N is the
           batch size, L is the target sequence length, and S is the
           source sequence length. If "average_attn_weights=False",
           returns attention weights per head of shape
           (\text{num_heads}, L, S) when input is unbatched or (N,
           \text{num_heads}, L, S).
         Note:
           batch_first argument is ignored for unbatched inputs.
   merge_masks(attn_mask, key_padding_mask, query)
      Determine mask type and combine masks if necessary. If only one
      mask is provided, that mask and the corresponding mask type will
      be returned. If both masks are provided, they will be both
      expanded to shape "(batch_size, num_heads, seq_len, seq_len)",
      combined with logical "or" and mask type 2 will be returned


:param attn_mask: attention mask of shape "(seq_len, seq_len)",
      mask type 0 :param key_padding_mask: padding mask of shape
      "(batch_size, seq_len)", mask type 1 :param query: query
      embeddings of shape "(batch_size, seq_len, embed_dim)"
      Returns:
         merged mask mask_type: merged mask type (0, 1, or 2)
      Return type:
         merged_mask


torch.bitwise_xortorch.bitwise_xor(input, other, , out=None) -> Tensor
   Computes the bitwise XOR of "input" and "other". The input tensor
   must be of integral or Boolean types. For bool tensors, it computes
   the logical XOR.
   Parameters:
      * input -- the first input tensor
      * other -- the second input tensor
   Keyword Arguments:
      out (Tensor, optional*) -- the output tensor.
   Example:
      >>> torch.bitwise_xor(torch.tensor([-1, -2, 3], dtype=torch.int8), torch.tensor([1, 0, 3], dtype=torch.int8))
      tensor([-2, -2,  0], dtype=torch.int8)
      >>> torch.bitwise_xor(torch.tensor([True, True, False]), torch.tensor([False, True, False]))
      tensor([ True, False, False])


torch.cuda.list_gpu_processestorch.cuda.list_gpu_processes(device=None)
   Returns a human-readable printout of the running processes and
   their GPU memory use for a given device.
   This can be useful to display periodically during training, or when
   handling out-of-memory exceptions.
   Parameters:
      device (torch.device or int, optional) -- selected
      device. Returns printout for the current device, given by
      "current_device()", if "device" is "None" (default).
   Return type:
      str


torch.full_liketorch.full_like(input, fill_value, *, dtype=None, layout=torch.strided, device=None, requires_grad=False, memory_format=torch.preserve_format) -> Tensor
   Returns a tensor with the same size as "input" filled with
   "fill_value". "torch.full_like(input, fill_value)" is equivalent to
   "torch.full(input.size(), fill_value, dtype=input.dtype,
   layout=input.layout, device=input.device)".
   Parameters:
      * input (Tensor) -- the size of "input" will determine
        size of the output tensor.
      * fill_value -- the number to fill the output tensor with.
   Keyword Arguments:
      * dtype ("torch.dtype", optional) -- the desired data type
        of returned Tensor. Default: if "None", defaults to the dtype
        of "input".
      * layout ("torch.layout", optional) -- the desired layout of
        returned tensor. Default: if "None", defaults to the layout of
        "input".
      * device ("torch.device", optional) -- the desired device of


returned tensor. Default: if "None", defaults to the device of
        "input".
      * requires_grad (bool, optional) -- If autograd should
        record operations on the returned tensor. Default: "False".
      * memory_format ("torch.memory_format", optional) -- the
        desired memory format of returned Tensor. Default:
        "torch.preserve_format".


ConvTranspose2dclass torch.nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=1, padding=0, output_padding=0, groups=1, bias=True, dilation=1, padding_mode='zeros', device=None, dtype=None)
   Applies a 2D transposed convolution operator over an input image
   composed of several input planes.
   This module can be seen as the gradient of Conv2d with respect to
   its input. It is also known as a fractionally-strided convolution
   or a deconvolution (although it is not an actual deconvolution
   operation as it does not compute a true inverse of convolution).
   For more information, see the visualizations here and the
   Deconvolutional Networks paper.
   This module supports TensorFloat32.
   On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.
   * "stride" controls the stride for the cross-correlation.
   * "padding" controls the amount of implicit zero padding on both


sides for "dilation * (kernel_size - 1) - padding" number of
     points. See note below for details.
   * "output_padding" controls the additional size added to one side
     of the output shape. See note below for details.
   * "dilation" controls the spacing between the kernel points; also
     known as the Ã  trous algorithm. It is harder to describe, but the
     link here has a nice visualization of what "dilation" does.
   * "groups" controls the connections between inputs and outputs.
     "in_channels" and "out_channels" must both be divisible by
     "groups". For example,
        * At groups=1, all inputs are convolved to all outputs.
        * At groups=2, the operation becomes equivalent to having two
          conv layers side by side, each seeing half the input
          channels and producing half the output channels, and both
          subsequently concatenated.
        * At groups= "in_channels", each input channel is convolved
          with its own set of filters (of size


with its own set of filters (of size
          \frac{\text{out_channels}}{\text{in_channels}}).
   The parameters "kernel_size", "stride", "padding", "output_padding"
   can either be:
      * a single "int" -- in which case the same value is used for the
        height and width dimensions
      * 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
   Note:
     The "padding" argument effectively adds "dilation * (kernel_size
     - 1) - padding" amount of zero padding to both sizes of the
     input. This is set so that when a "Conv2d" and a
     "ConvTranspose2d" are initialized with same parameters, they are
     inverses of each other in regard to the input and output shapes.
     However, when "stride > 1", "Conv2d" maps multiple input shapes
     to the same output shape. "output_padding" is provided to resolve
     this ambiguity by effectively increasing the calculated output


shape on one side. Note that "output_padding" is only used to
     find output shape, but does not actually add zero-padding to
     output.
   Note:
     In some circumstances when given tensors on a CUDA device and
     using CuDNN, this operator may select a nondeterministic
     algorithm to increase performance. If this is undesirable, you
     can try to make the operation deterministic (potentially at a
     performance cost) by setting "torch.backends.cudnn.deterministic
     = True". See Reproducibility for more information.
   Parameters:
      * in_channels (int) -- Number of channels in the input
        image
      * out_channels (int) -- Number of channels produced by the
        convolution
      * kernel_size (int or tuple) -- Size of the convolving
        kernel
      * stride (int or tuple, optional) -- Stride of the
        convolution. Default: 1
      * padding (int or tuple, optional) -- "dilation *


(kernel_size - 1) - padding" zero-padding will be added to
        both sides of each dimension in the input. Default: 0
      * output_padding (int or tuple, optional) --
        Additional size added to one side of each dimension in the
        output shape. Default: 0
      * groups (int, optional) -- Number of blocked
        connections from input channels to output channels. Default: 1
      * bias (bool, optional) -- If "True", adds a learnable
        bias to the output. Default: "True"
      * dilation (int or tuple, optional) -- Spacing
        between kernel elements. Default: 1
   Shape:
      * Input: (N, C_{in}, H_{in}, W_{in}) or (C_{in}, H_{in}, W_{in})
      * Output: (N, C_{out}, H_{out}, W_{out}) or (C_{out}, H_{out},
        W_{out}), where
         H_{out} = (H_{in} - 1) \times \text{stride}[0] - 2 \times
         \text{padding}[0] + \text{dilation}[0]           \times


(\text{kernel_size}[0] - 1) + \text{output_padding}[0] + 1
         W_{out} = (W_{in} - 1) \times \text{stride}[1] - 2 \times
         \text{padding}[1] + \text{dilation}[1]           \times
         (\text{kernel_size}[1] - 1) + \text{output_padding}[1] + 1
   Variables:
      * weight (Tensor) -- the learnable weights of the module
        of shape (\text{in_channels},
        \frac{\text{out_channels}}{\text{groups}},
        \text{kernel_size[0]}, \text{kernel_size[1]}). The values of
        these weights are sampled from \mathcal{U}(-\sqrt{k},
        \sqrt{k}) where k = \frac{groups}{C_\text{out} *
        \prod_{i=0}^{1}\text{kernel_size}[i]}
      * bias (Tensor) -- the learnable bias of the module of
        shape (out_channels) If "bias" is "True", then the values of
        these weights are sampled from \mathcal{U}(-\sqrt{k},
        \sqrt{k}) where k = \frac{groups}{C_\text{out} *
        \prod_{i=0}^{1}\text{kernel_size}[i]}
   Examples:


Examples:
      >>> # With square kernels and equal stride
      >>> m = nn.ConvTranspose2d(16, 33, 3, stride=2)
      >>> # non-square kernels and unequal stride and with padding
      >>> m = nn.ConvTranspose2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
      >>> input = torch.randn(20, 16, 50, 100)
      >>> output = m(input)
      >>> # exact output size can be also specified as an argument
      >>> input = torch.randn(1, 16, 12, 12)
      >>> downsample = nn.Conv2d(16, 16, 3, stride=2, padding=1)
      >>> upsample = nn.ConvTranspose2d(16, 16, 3, stride=2, padding=1)
      >>> h = downsample(input)
      >>> h.size()
      torch.Size([1, 16, 6, 6])
      >>> output = upsample(h, output_size=input.size())
      >>> output.size()
      torch.Size([1, 16, 12, 12])


torch.cuda.comm.reduce_addtorch.cuda.comm.reduce_add(inputs, destination=None)
   Sums tensors from multiple GPUs.
   All inputs should have matching shapes, dtype, and layout. The
   output tensor will be of the same shape, dtype, and layout.
   Parameters:
      * inputs (Iterable[Tensor]) -- an iterable of
        tensors to add.
      * destination (int, optional) -- a device on which the
        output will be placed (default: current device).
   Returns:
      A tensor containing an elementwise sum of all inputs, placed on
      the "destination" device.


torch.Tensor.negativeTensor.negative() -> Tensor
   See "torch.negative()"


torch.Tensor.tTensor.t() -> Tensor
   See "torch.t()"


torch.Tensor.cauchy_Tensor.cauchy_(median=0, sigma=1, *, generator=None) -> Tensor
   Fills the tensor with numbers drawn from the Cauchy distribution:
      f(x) = \dfrac{1}{\pi} \dfrac{\sigma}{(x - \text{median})^2 +
      \sigma^2}


torch.autograd.functional.hvptorch.autograd.functional.hvp(func, inputs, v=None, create_graph=False, strict=False)
   Function that computes the dot product between the Hessian of a
   given scalar function and a vector "v" at the point given by the
   inputs.
   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".
      * v (tuple of Tensors or Tensor) -- The vector for
        which the Hessian vector product is computed. Must be the same
        size as the input of "func". This argument is optional when
        "func"'s input contains a single element and (if it is not
        provided) will be set as a Tensor containing a single "1".
      * create_graph (bool, optional) -- If "True", both the
        output and result will be computed in a differentiable way.


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 hvp for said inputs, which is the
        expected mathematical value. Defaults to "False".
   Returns:
      tuple with:
         func_output (tuple of Tensors or Tensor): output of
         "func(inputs)"
         hvp (tuple of Tensors or Tensor): result of the dot product
         with the same shape as the inputs.
   Return type:
      output (tuple)
   -[ Example ]-

def pow_reducer(x):
   ...     return x.pow(3).sum()
inputs = torch.rand(2, 2)
v = torch.ones(2, 2)
hvp(pow_reducer, inputs, v)
   (tensor(0.1448),
    tensor([[2.0239, 1.6456],
            [2.4988, 1.4310]]))


[2.4988, 1.4310]]))

hvp(pow_reducer, inputs, v, create_graph=True)
   (tensor(0.1448, grad_fn=),
    tensor([[2.0239, 1.6456],
            [2.4988, 1.4310]], 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))
v = (torch.zeros(2), torch.ones(2))
hvp(pow_adder_reducer, inputs, v)
   (tensor(2.3030),
    (tensor([0., 0.]),
     tensor([6., 6.])))
   Note:
     This function is significantly slower than vhp due to backward
     mode AD constraints. If your functions is twice continuously
     differentiable, then hvp = vhp.t(). So if you know that your
     function satisfies this condition, you should use vhp instead
     that is much faster with the current implementation.


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


torch.Tensor.ltTensor.lt(other) -> Tensor
   See "torch.lt()".


torch.Tensor.expTensor.exp() -> Tensor
   See "torch.exp()"


torch.nn.functional.conv2dtorch.nn.functional.conv2d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1) -> Tensor
   Applies a 2D convolution over an input image composed of several
   input planes.
   This operator supports TensorFloat32.
   See "Conv2d" for details and output shape.
   Note:
     In some circumstances when given tensors on a CUDA device and
     using CuDNN, this operator may select a nondeterministic
     algorithm to increase performance. If this is undesirable, you
     can try to make the operation deterministic (potentially at a
     performance cost) by setting "torch.backends.cudnn.deterministic
     = True". See Reproducibility for more information.
   Note:
     This operator supports complex data types i.e. "complex32,
     complex64, complex128".
   Parameters:
      * input -- input tensor of shape (\text{minibatch} ,
        \text{in_channels} , iH , iW)
      * weight -- filters of shape (\text{out_channels} ,


\frac{\text{in_channels}}{\text{groups}} , kH , kW)
      * bias -- optional bias tensor of shape
        (\text{out_channels}). Default: "None"
      * stride -- the stride of the convolving kernel. Can be a
        single number or a tuple (sH, sW). Default: 1
      * padding --
        implicit paddings on both sides of the input. Can be a string
        {'valid', 'same'}, single number or a tuple (padH, padW).
        Default: 0 "padding='valid'" is the same as no padding.
        "padding='same'" pads the input so the output has the same
        shape as the input. However, this mode doesn't support any
        stride values other than 1.
        Warning:
          For "padding='same'", if the "weight" is even-length and
          "dilation" is odd in any dimension, a full "pad()" operation
          may be needed internally. Lowering performance.
      * dilation -- the spacing between kernel elements. Can be a
        single number or a tuple (dH, dW). Default: 1


groups -- split input into groups, \text{in_channels}
        should be divisible by the number of groups. Default: 1
   Examples:
      >>> # With square kernels and equal stride
      >>> filters = torch.randn(8, 4, 3, 3)
      >>> inputs = torch.randn(1, 4, 5, 5)
      >>> F.conv2d(inputs, filters, padding=1)


torch.func.vmaptorch.func.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.

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.Tensor.bernoulli_Tensor.bernoulli_(p=0.5, , generator=None) -> Tensor
   Fills each location of "self" with an independent sample from
   \text{Bernoulli}(\texttt{p}). "self" can have integral "dtype".
   "p" should either be a scalar or tensor containing probabilities to
   be used for drawing the binary random number.
   If it is a tensor, the \text{i}^{th} element of "self" tensor will
   be set to a value sampled from
   \text{Bernoulli}(\texttt{p_tensor[i]}). In this case p* must have
   floating point "dtype".
   See also "bernoulli()" and "torch.bernoulli()"


torch.Tensor.is_metaTensor.is_meta
   Is "True" if the Tensor is a meta tensor, "False" otherwise.  Meta
   tensors are like normal tensors, but they carry no data.


torch.jit.onednn_fusion_enabledtorch.jit.onednn_fusion_enabled()
   Returns whether onednn JIT fusion is enabled


torch.Tensor.absolute_Tensor.absolute_() -> Tensor
   In-place version of "absolute()" Alias for "abs_()"


torch.logaddexp2torch.logaddexp2(input, other, , out=None) -> Tensor
   Logarithm of the sum of exponentiations of the inputs in base-2.
   Calculates pointwise \log_2\left(2^x + 2^y\right). See
   "torch.logaddexp()" for more details.
   Parameters:
      * input (Tensor) -- the input tensor.
      * other (Tensor) -- the second input tensor
   Keyword Arguments:
      out (Tensor, optional*) -- the output tensor.


torch.cuda.memory_snapshottorch.cuda.memory_snapshot()
   Returns a snapshot of the CUDA memory allocator state across all
   devices.
   Interpreting the output of this function requires familiarity with
   the memory allocator internals.
   Note:
     See Memory management for more details about GPU memory
     management.


torch.Tensor.sigmoidTensor.sigmoid() -> Tensor
   See "torch.sigmoid()"


LazyInstanceNorm2dclass torch.nn.LazyInstanceNorm2d(eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)
   A "torch.nn.InstanceNorm2d" module with lazy initialization of the
   "num_features" argument of the "InstanceNorm2d" that is inferred
   from the "input.size(1)". The attributes that will be lazily
   initialized are weight, bias, running_mean and running_var.
   Check the "torch.nn.modules.lazy.LazyModuleMixin" for further
   documentation on lazy modules and their limitations.
   Parameters:
      * num_features -- C from an expected input of size (N, C, H,
        W) or (C, H, W)
      * eps (float) -- a value added to the denominator for
        numerical stability. Default: 1e-5
      * momentum (float) -- the value used for the running_mean
        and running_var computation. Default: 0.1
      * affine (bool) -- a boolean value that when set to
        "True", this module has learnable affine parameters,


initialized the same way as done for batch normalization.
        Default: "False".
      * track_running_stats (bool) -- a boolean value that when
        set to "True", this module tracks the running mean and
        variance, and when set to "False", this module does not track
        such statistics and always uses batch statistics in both
        training and eval modes. Default: "False"
   Shape:
      * Input: (N, C, H, W) or (C, H, W)
      * Output: (N, C, H, W) or (C, H, W) (same shape as input)
   cls_to_become
      alias of "InstanceNorm2d"


torch.isrealtorch.isreal(input) -> Tensor
   Returns a new tensor with boolean elements representing if each
   element of "input" is real-valued or not. All real-valued types are
   considered real. Complex values are considered real when their
   imaginary part is 0.
   Parameters:
      input (Tensor) -- the input tensor.
   Returns:
      A boolean tensor that is True where "input" is real and False
      elsewhere
   Example:
      >>> torch.isreal(torch.tensor([1, 1+1j, 2+0j]))
      tensor([True, False, True])


TransformerEncoderLayerclass torch.nn.TransformerEncoderLayer(d_model, nhead, dim_feedforward=2048, dropout=0.1, activation=, layer_norm_eps=1e-05, batch_first=False, norm_first=False, device=None, dtype=None)
   TransformerEncoderLayer is made up of self-attn and feedforward
   network. This standard encoder layer is based on the paper
   "Attention Is All You Need". Ashish Vaswani, Noam Shazeer, Niki
   Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser,
   and Illia Polosukhin. 2017. Attention is all you need. In Advances
   in Neural Information Processing Systems, pages 6000-6010. Users
   may modify or implement in a different way during application.
   Parameters:
      * d_model (int) -- the number of expected features in the
        input (required).
      * nhead (int) -- the number of heads in the
        multiheadattention models (required).
      * dim_feedforward (int) -- the dimension of the


feedforward network model (default=2048).
      * dropout (float) -- the dropout value (default=0.1).
      * activation (Union[str,
        Callable[[Tensor], Tensor]]) -- the
        activation function of the intermediate layer, can be a string
        ("relu" or "gelu") or a unary callable. Default: relu
      * layer_norm_eps (float) -- the eps value in layer
        normalization components (default=1e-5).
      * batch_first (bool) -- If "True", then the input and
        output tensors are provided as (batch, seq, feature). Default:
        "False" (seq, batch, feature).
      * norm_first (bool) -- if "True", layer norm is done prior
        to attention and feedforward operations, respectively.
        Otherwise it's done after. Default: "False" (after).
   Examples::
      >>> encoder_layer = nn.TransformerEncoderLayer(d_model=512, nhead=8)
      >>> src = torch.rand(10, 32, 512)
      >>> out = encoder_layer(src)


out = encoder_layer(src)
   Alternatively, when "batch_first" is "True":
      >>> encoder_layer = nn.TransformerEncoderLayer(d_model=512, nhead=8, batch_first=True)
      >>> src = torch.rand(32, 10, 512)
      >>> out = encoder_layer(src)
   Fast path:
      forward() will use a special optimized implementation if all of
      the following conditions are met:
      * Either autograd is disabled (using "torch.inference_mode" or
        "torch.no_grad") or no tensor argument "requires_grad"
      * training is disabled (using ".eval()")
      * batch_first is "True" and the input is batched (i.e.,
        "src.dim() == 3")
      * activation is one of: ""relu"", ""gelu"",
        "torch.functional.relu", or "torch.functional.gelu"
      * at most one of "src_mask" and "src_key_padding_mask" is passed
      * if src is a NestedTensor, neither "src_mask" nor
        "src_key_padding_mask" is passed
      * the two "LayerNorm" instances have a consistent "eps" value


(this will naturally be the case unless the caller has
        manually modified one without modifying the other)
      If the optimized implementation is in use, a NestedTensor can be
      passed for "src" to represent padding more efficiently than
      using a padding mask. In this case, a NestedTensor will be
      returned, and an additional speedup proportional to the fraction
      of the input that is padding can be expected.
   forward(src, src_mask=None, src_key_padding_mask=None, is_causal=False)
      Pass the input through the encoder layer.
      Parameters:
         * src (Tensor) -- the sequence to the encoder layer
           (required).
         * src_mask (Optional[Tensor]) -- the mask for the
           src sequence (optional).
         * is_causal (bool) -- If specified, applies a causal
           mask as src_mask. Mutually exclusive with providing
           src_mask. Default: "False".
         * src_key_padding_mask (Optional[Tensor]) -- the


mask for the src keys per batch (optional).
      Return type:
         Tensor
      Shape:
         see the docs in Transformer class.


MaxUnpool3dclass torch.nn.MaxUnpool3d(kernel_size, stride=None, padding=0)
   Computes a partial inverse of "MaxPool3d".
   "MaxPool3d" is not fully invertible, since the non-maximal values
   are lost. "MaxUnpool3d" takes in as input the output of "MaxPool3d"
   including the indices of the maximal values and computes a partial
   inverse in which all non-maximal values are set to zero.
   Note:
     "MaxPool3d" can map several input sizes to the same output sizes.
     Hence, the inversion process can get ambiguous. To accommodate
     this, you can provide the needed output size as an additional
     argument "output_size" in the forward call. See the Inputs
     section below.
   Parameters:
      * kernel_size (int or tuple) -- Size of the max
        pooling window.
      * stride (int or tuple) -- Stride of the max pooling
        window. It is set to "kernel_size" by default.
      * padding (int or tuple) -- Padding that was added to
        the input


the input
   Inputs:
      * input: the input Tensor to invert
      * indices: the indices given out by "MaxPool3d"
      * output_size (optional): the targeted output size
   Shape:
      * Input: (N, C, D_{in}, H_{in}, W_{in}) or (C, D_{in}, H_{in},
        W_{in}).
      * Output: (N, C, D_{out}, H_{out}, W_{out}) or (C, D_{out},
        H_{out}, W_{out}), where
           D_{out} = (D_{in} - 1) \times \text{stride[0]} - 2 \times
           \text{padding[0]} + \text{kernel_size[0]}
           H_{out} = (H_{in} - 1) \times \text{stride[1]} - 2 \times
           \text{padding[1]} + \text{kernel_size[1]}
           W_{out} = (W_{in} - 1) \times \text{stride[2]} - 2 \times
           \text{padding[2]} + \text{kernel_size[2]}
        or as given by "output_size" in the call operator
   Example:
      >>> # pool of square window of size=3, stride=2
      >>> pool = nn.MaxPool3d(3, stride=2, return_indices=True)
      >>> unpool = nn.MaxUnpool3d(3, stride=2)


unpool = nn.MaxUnpool3d(3, stride=2)
      >>> output, indices = pool(torch.randn(20, 16, 51, 33, 15))
      >>> unpooled_output = unpool(output, indices)
      >>> unpooled_output.size()
      torch.Size([20, 16, 51, 33, 15])