text stringlengths 0 1.73k | source stringlengths 35 119 | category stringclasses 2
values |
|---|---|---|
factorization of "LD".
* B (Tensor) -- right-hand side tensor of shape (, n,
k).
Keyword Arguments:
* hermitian (bool, optional) -- whether to consider
the decomposed matrix to be Hermitian or symmetric. For real-
valued matrices, this switch has no effect. Default: False.
*... | https://pytorch.org/docs/stable/generated/torch.linalg.ldl_solve.html | pytorch docs |
torch.tantorch.tan(input, , out=None) -> Tensor
Returns a new tensor with the tangent of the elements of "input".
\text{out}{i} = \tan(\text{input})
Parameters:
input (Tensor) -- the input tensor.
Keyword Arguments:
out (Tensor, optional*) -- the output tensor.
Example:
>>> a = torch... | https://pytorch.org/docs/stable/generated/torch.tan.html | pytorch docs |
torch.Tensor.greater_equal_Tensor.greater_equal_(other) -> Tensor
In-place version of "greater_equal()". | https://pytorch.org/docs/stable/generated/torch.Tensor.greater_equal_.html | pytorch docs |
default_fused_per_channel_wt_fake_quanttorch.quantization.fake_quantize.default_fused_per_channel_wt_fake_quant
alias of functools.partial(, observer=,
quant_min=-128, quant_max=127, dtype=torch.qint8,
qscheme=torch.per_channel_symmetric){} | https://pytorch.org/docs/stable/generated/torch.quantization.fake_quantize.default_fused_per_channel_wt_fake_quant.html | pytorch docs |
torch.optim.Optimizer.state_dictOptimizer.state_dict()
Returns the state of the optimizer as a "dict".
It contains two entries:
* state - a dict holding current optimization state. Its content
differs between optimizer classes.
* param_groups - a list containing all parameter groups where each
... | https://pytorch.org/docs/stable/generated/torch.optim.Optimizer.state_dict.html | pytorch docs |
leaky_reluclass torch.ao.nn.quantized.functional.leaky_relu(input, negative_slope=0.01, inplace=False, scale=None, zero_point=None)
Quantized version of the. leaky_relu(input, negative_slope=0.01,
inplace=False, scale, zero_point) -> Tensor
Applies element-wise, \text{LeakyReLU}(x) = \max(0, x) +
\text{nega... | https://pytorch.org/docs/stable/generated/torch.ao.nn.quantized.functional.leaky_relu.html | pytorch docs |
torch.func.jacfwdtorch.func.jacfwd(func, argnums=0, has_aux=False, , randomness='error')
Computes the Jacobian of "func" with respect to the arg(s) at index
"argnum" using forward-mode autodiff
Parameters:
* func (function) -- A Python function that takes one or
more arguments, one of which must ... | https://pytorch.org/docs/stable/generated/torch.func.jacfwd.html | pytorch docs |
"different", "same", "error". Default: "error"
Returns:
Returns a function that takes in the same inputs as "func" and
returns the Jacobian of "func" with respect to the arg(s) at
"argnums". If "has_aux is True", then the returned function
instead returns a "(jacobian, aux)" tuple where "jaco... | https://pytorch.org/docs/stable/generated/torch.func.jacfwd.html | pytorch docs |
from torch.func import jacfwd, vmap
x = torch.randn(64, 5)
jacobian = vmap(jacfwd(torch.sin))(x)
assert jacobian.shape == (64, 5, 5)
If you would like to compute the output of the function as well as
the jacobian of the function, use the "has_aux" flag to return the
output as an auxiliary object:
from torch... | https://pytorch.org/docs/stable/generated/torch.func.jacfwd.html | pytorch docs |
first input. However, it can compute the Jacboian with respect to a
different argument by using "argnums":
from torch.func import jacfwd
def f(x, y):
return x + y ** 2
x, y = torch.randn(5), torch.randn(5)
jacobian = jacfwd(f, argnums=1)(x, y)
expected = torch.diag(2 * y)
assert torch.allclose(jacobian, expecte... | https://pytorch.org/docs/stable/generated/torch.func.jacfwd.html | pytorch docs |
torch._foreach_exptorch._foreach_exp(self: List[Tensor]) -> List[Tensor]
Apply "torch.exp()" to each Tensor of the input list. | https://pytorch.org/docs/stable/generated/torch._foreach_exp.html | pytorch docs |
torch.linalg.solve_extorch.linalg.solve_ex(A, B, , left=True, check_errors=False, out=None)
A version of "solve()" that does not perform error checks unless
"check_errors"= True. It also returns the "info" tensor returned
by LAPACK's getrf.
Note:
When the inputs are on a CUDA device, this function sync... | https://pytorch.org/docs/stable/generated/torch.linalg.solve_ex.html | pytorch docs |
write the output to. Ignored if None. Default: None.
Returns:
A named tuple (result, info).
Examples:
>>> A = torch.randn(3, 3)
>>> Ainv, info = torch.linalg.solve_ex(A)
>>> torch.dist(torch.linalg.inv(A), Ainv)
tensor(0.)
>>> info
tensor(0, dtype=torch.int32) | https://pytorch.org/docs/stable/generated/torch.linalg.solve_ex.html | pytorch docs |
torch.nn.functional.smooth_l1_losstorch.nn.functional.smooth_l1_loss(input, target, size_average=None, reduce=None, reduction='mean', beta=1.0)
Function that uses a squared term if the absolute element-wise
error falls below beta and an L1 term otherwise.
See "SmoothL1Loss" for details.
Return type:
T... | https://pytorch.org/docs/stable/generated/torch.nn.functional.smooth_l1_loss.html | pytorch docs |
MaxPool2dclass torch.nn.MaxPool2d(kernel_size, stride=None, padding=0, dilation=1, return_indices=False, ceil_mode=False)
Applies a 2D max pooling over an input signal composed of several
input planes.
In the simplest case, the output value of the layer with input size
(N, C, H, W), output (N, C, H_{out}, W... | https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html | pytorch docs |
"dilation" does.
Note:
When ceil_mode=True, sliding windows are allowed to go off-bounds
if they start within the left padding or the input. Sliding
windows that would start in the right padded region are ignored.
The parameters "kernel_size", "stride", "padding", "dilation" can
either be:
... | https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html | pytorch docs |
added on both sides
* dilation (Union[int, Tuple[int,
int]]) -- a parameter that controls the stride of
elements in the window
* return_indices (bool) -- if "True", will return the max
indices along with the outputs. Useful for
"torch.nn.MaxUnpool2d" later
* ceil_mode (... | https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html | pytorch docs |
Examples:
>>> # pool of square window of size=3, stride=2
>>> m = nn.MaxPool2d(3, stride=2)
>>> # pool of non-square window
>>> m = nn.MaxPool2d((3, 2), stride=(2, 1))
>>> input = torch.randn(20, 16, 50, 32)
>>> output = m(input) | https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html | pytorch docs |
torch.jit.forktorch.jit.fork(func, args, kwargs)
Creates an asynchronous task executing func and a reference to
the value of the result of this execution. fork will return
immediately, so the return value of func may not have been
computed yet. To force completion of the task and access the return
value ... | https://pytorch.org/docs/stable/generated/torch.jit.fork.html | pytorch docs |
modify their inputs, module attributes, or global state.
Parameters:
* func (callable or torch.nn.Module) -- A Python
function or torch.nn.Module that will be invoked. If
executed in TorchScript, it will execute asynchronously,
otherwise it will not. Traced invocations of fork will be
... | https://pytorch.org/docs/stable/generated/torch.jit.fork.html | pytorch docs |
script_bar = torch.jit.script(bar)
input = torch.tensor(2)
# only the scripted version executes asynchronously
assert script_bar(input) == bar(input)
# trace is not run asynchronously, but fork is captured in IR
graph = torch.jit.trace(bar, (input,)).graph
assert "fork" in str(graph)... | https://pytorch.org/docs/stable/generated/torch.jit.fork.html | pytorch docs |
torch.Tensor.conjTensor.conj() -> Tensor
See "torch.conj()" | https://pytorch.org/docs/stable/generated/torch.Tensor.conj.html | pytorch docs |
torch.nn.functional.logsigmoidtorch.nn.functional.logsigmoid(input) -> Tensor
Applies element-wise \text{LogSigmoid}(x_i) = \log \left(\frac{1}{1
+ \exp(-x_i)}\right)
See "LogSigmoid" for more details. | https://pytorch.org/docs/stable/generated/torch.nn.functional.logsigmoid.html | pytorch docs |
Parameterclass torch.nn.parameter.Parameter(data=None, requires_grad=True)
A kind of Tensor that is to be considered a module parameter.
Parameters are "Tensor" subclasses, that have a very special
property when used with "Module" s - when they're assigned as
Module attributes they are automatically added t... | https://pytorch.org/docs/stable/generated/torch.nn.parameter.Parameter.html | pytorch docs |
torch.foreach_lgamma_torch._foreach_lgamma(self: List[Tensor]) -> None
Apply "torch.lgamma()" to each Tensor of the input list. | https://pytorch.org/docs/stable/generated/torch._foreach_lgamma_.html | pytorch docs |
torch.Tensor.q_zero_pointTensor.q_zero_point() -> int
Given a Tensor quantized by linear(affine) quantization, returns
the zero_point of the underlying quantizer(). | https://pytorch.org/docs/stable/generated/torch.Tensor.q_zero_point.html | pytorch docs |
torch.Tensor.dimTensor.dim() -> int
Returns the number of dimensions of "self" tensor. | https://pytorch.org/docs/stable/generated/torch.Tensor.dim.html | pytorch docs |
PlaceholderObserverclass torch.quantization.observer.PlaceholderObserver(dtype=torch.float32, custom_op_name='', compute_dtype=None, quant_min=None, quant_max=None, is_dynamic=False)
Observer that doesn't do anything and just passes its configuration
to the quantized module's ".from_float()".
Can be used for q... | https://pytorch.org/docs/stable/generated/torch.quantization.observer.PlaceholderObserver.html | pytorch docs |
quantize function to use dynamic quantization instead of
static quantization. This field is deprecated, use
is_dynamic=True instead.
* is_dynamic -- if True, the quantize function in the
reference model representation taking stats from this observer
instance will use dynamic quanti... | https://pytorch.org/docs/stable/generated/torch.quantization.observer.PlaceholderObserver.html | pytorch docs |
torch.Tensor.element_sizeTensor.element_size() -> int
Returns the size in bytes of an individual element.
Example:
>>> torch.tensor([]).element_size()
4
>>> torch.tensor([], dtype=torch.uint8).element_size()
1 | https://pytorch.org/docs/stable/generated/torch.Tensor.element_size.html | pytorch docs |
torch.Tensor.sin_Tensor.sin_() -> Tensor
In-place version of "sin()" | https://pytorch.org/docs/stable/generated/torch.Tensor.sin_.html | pytorch docs |
torch.Tensor.lcmTensor.lcm(other) -> Tensor
See "torch.lcm()" | https://pytorch.org/docs/stable/generated/torch.Tensor.lcm.html | pytorch docs |
torch.nn.utils.parametrize.is_parametrizedtorch.nn.utils.parametrize.is_parametrized(module, tensor_name=None)
Returns "True" if module has an active parametrization.
If the argument "tensor_name" is specified, returns "True" if
"module[tensor_name]" is parametrized.
Parameters:
* module (nn.Module) -... | https://pytorch.org/docs/stable/generated/torch.nn.utils.parametrize.is_parametrized.html | pytorch docs |
torch.Tensor.scatter_reduce_Tensor.scatter_reduce_(dim, index, src, reduce, *, include_self=True) -> Tensor
Reduces all values from the "src" tensor to the indices specified
in the "index" tensor in the "self" tensor using the applied
reduction defined via the "reduce" argument (""sum"", ""prod"",
""mean"",... | https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_reduce_.html | pytorch docs |
output is given as:
self[index[i][j][k]][j][k] += src[i][j][k] # if dim == 0
self[i][index[i][j][k]][k] += src[i][j][k] # if dim == 1
self[i][j][index[i][j][k]] += src[i][j][k] # if dim == 2
Note:
This operation may behave nondeterministically when given tensors
on a CUDA device. See R... | https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_reduce_.html | pytorch docs |
tensor are included in the reduction
Example:
>>> src = torch.tensor([1., 2., 3., 4., 5., 6.])
>>> index = torch.tensor([0, 1, 0, 1, 2, 1])
>>> input = torch.tensor([1., 2., 3., 4.])
>>> input.scatter_reduce(0, index, src, reduce="sum")
tensor([5., 14., 8., 4.])
>>> input.scatter_... | https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_reduce_.html | pytorch docs |
torch._foreach_sinhtorch._foreach_sinh(self: List[Tensor]) -> List[Tensor]
Apply "torch.sinh()" to each Tensor of the input list. | https://pytorch.org/docs/stable/generated/torch._foreach_sinh.html | pytorch docs |
torch.negativetorch.negative(input, *, out=None) -> Tensor
Alias for "torch.neg()" | https://pytorch.org/docs/stable/generated/torch.negative.html | pytorch docs |
ReflectionPad3dclass torch.nn.ReflectionPad3d(padding)
Pads the input tensor using the reflection of the input boundary.
For N-dimensional padding, use "torch.nn.functional.pad()".
Parameters:
padding (int, tuple) -- the size of the padding. If is
int, uses the same padding in all boundaries. If a ... | https://pytorch.org/docs/stable/generated/torch.nn.ReflectionPad3d.html | pytorch docs |
Examples:
>>> m = nn.ReflectionPad3d(1)
>>> input = torch.arange(8, dtype=torch.float).reshape(1, 1, 2, 2, 2)
>>> m(input)
tensor([[[[[7., 6., 7., 6.],
[5., 4., 5., 4.],
[7., 6., 7., 6.],
[5., 4., 5., 4.]],
[[3., 2., 3., 2.],
... | https://pytorch.org/docs/stable/generated/torch.nn.ReflectionPad3d.html | pytorch docs |
torch.nn.functional.grid_sampletorch.nn.functional.grid_sample(input, grid, mode='bilinear', padding_mode='zeros', align_corners=None)
Given an "input" and a flow-field "grid", computes the "output"
using "input" values and pixel locations from "grid".
Currently, only spatial (4-D) and volumetric (5-D) "input"... | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
interpolation method to sample the input pixels.
"grid" specifies the sampling pixel locations normalized by the
"input" spatial dimensions. Therefore, it should have most values
in the range of "[-1, 1]". For example, values "x = -1, y = -1" is
the left-top pixel of "input", and values "x = 1, y = 1" is t... | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
reflects by border "1" and becomes "x'' = -0.5".
Note:
This function is often used in conjunction with "affine_grid()"
to build Spatial Transformer Networks .
Note:
When using the CUDA backend, this operation may induce
nondeterministic behaviour in its backward pass that is not
easily sw... | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
"'bilinear'" Note: "mode='bicubic'" supports only 4-D input.
When "mode='bilinear'" and the input is 5-D, the interpolation
mode used internally will actually be trilinear. However, when
the input is 4-D, the interpolation mode will legitimately be
bilinear.
* padding_mode (str) --... | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
"interpolate()", and so whichever option is used here should
also be used there to resize the input image before grid
sampling. Default: "False"
Returns:
output Tensor
Return type:
output (Tensor)
Warning:
When "align_corners = True", the grid positions depend on the
pixel... | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
use -0.5 and -0.75 respectively. This algorithm may "overshoot"
the range of values it's interpolating. For example, it may
produce negative values or values greater than 255 when
interpolating input in [0, 255]. Clamp the results with :func:
torch.clamp to ensure they are within the valid range. | https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html | pytorch docs |
torch.isintorch.isin(elements, test_elements, , assume_unique=False, invert=False) -> Tensor
Tests if each element of "elements" is in "test_elements". Returns
a boolean tensor of the same shape as "elements" that is True for
elements in "test_elements" and False otherwise.
Note:
One of "elements" or "... | https://pytorch.org/docs/stable/generated/torch.isin.html | pytorch docs |
Returns:
A boolean tensor of the same shape as "elements" that is True
for elements in "test_elements" and False otherwise
-[ Example ]-
torch.isin(torch.tensor([[1, 2], [3, 4]]), torch.tensor([2, 3]))
tensor([[False, True],
[ True, False]])
| https://pytorch.org/docs/stable/generated/torch.isin.html | pytorch docs |
BackendPatternConfigclass torch.ao.quantization.backend_config.BackendPatternConfig(pattern=None)
Config object that specifies quantization behavior for a given
operator pattern. For a detailed example usage, see
"BackendConfig".
add_dtype_config(dtype_config)
Add a set of supported data types passed ... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
implementation for this pattern "reference_quantized_module":
a "torch.nn.Module" that represents the reference quantized
implementation for this pattern's root module.
"fused_module": a "torch.nn.Module" that represents the fused
implementation for this pattern "fuser_method": a fun... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
set_fuser_method(fuser_method)
Set the function that specifies how to fuse this
BackendPatternConfig's pattern.
The first argument of this function should be is_qat, and the
rest of the arguments should be the items in the tuple pattern.
The return value of this function should be the resu... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
desired reference patterns understood by the backend. Weighted
ops such as linear and conv require different observers (or
quantization parameters passed to quantize ops in the reference
model) for the input and the output.
There are two observation types:
OUTPUT_USE_DIFFERENT_OBSERVER_... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
operator, or a tuple combination of the above. Tuple patterns
are treated as sequential patterns, and currently only tuples of
2 or 3 elements are supported.
Return type:
BackendPatternConfig
set_qat_module(qat_module)
Set the module that represents the QAT implementation for this
... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
torch.ao.nn.reference.quantized.Linear). This allows custom
backends to specify custom reference quantized module
implementations to match the numerics of their lowered
operators. Since this is a one-to-one mapping, both the root
module and the reference quantized module must be specified in
... | https://pytorch.org/docs/stable/generated/torch.ao.quantization.backend_config.BackendPatternConfig.html | pytorch docs |
torch.randntorch.randn(size, , out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, pin_memory=False) -> Tensor
Returns a tensor filled with random numbers from a normal
distribution with mean 0 and variance 1 (also called the
standard normal distribution).
\text{out}_{i} \sim \m... | https://pytorch.org/docs/stable/generated/torch.randn.html | pytorch docs |
(see "torch.set_default_tensor_type()").
* layout ("torch.layout", optional) -- the desired layout of
returned Tensor. Default: "torch.strided".
* device ("torch.device", optional) -- the desired device of
returned tensor. Default: if "None", uses the current device
for the default t... | https://pytorch.org/docs/stable/generated/torch.randn.html | pytorch docs |
tensor([[ 1.5954, 2.8929, -1.0923],
[ 1.1719, -0.4709, -0.1996]]) | https://pytorch.org/docs/stable/generated/torch.randn.html | pytorch docs |
torch.linalg.lu_solvetorch.linalg.lu_solve(LU, pivots, B, , left=True, adjoint=False, out=None) -> Tensor
Computes the solution of a square system of linear equations with a
unique solution given an LU decomposition.
Letting \mathbb{K} be \mathbb{R} or \mathbb{C}, this function
computes the solution X \in \... | https://pytorch.org/docs/stable/generated/torch.linalg.lu_solve.html | pytorch docs |
\mathbb{K}^{n \times k} that solves the system
A^{\text{H}}X = B\mathrlap{\qquad A \in \mathbb{K}^{k \times k},
B \in \mathbb{K}^{n \times k}.}
where A^{\text{H}} is the conjugate transpose when A is complex,
and the transpose when A is real-valued. The "left"= False case
is analogous.
Supports ... | https://pytorch.org/docs/stable/generated/torch.linalg.lu_solve.html | pytorch docs |
k).
Keyword Arguments:
* left (bool, optional) -- whether to solve the system
AX=B or XA = B. Default: True.
* adjoint (bool, optional) -- whether to solve the
system AX=B or A^{\text{H}}X = B. Default: False.
* out (Tensor, optional) -- output tensor. Ignored if
None. Defau... | https://pytorch.org/docs/stable/generated/torch.linalg.lu_solve.html | pytorch docs |
X = torch.linalg.lu_solve(LU, pivots, B, adjoint=True)
>>> torch.allclose(A.mT @ X, B)
True
| https://pytorch.org/docs/stable/generated/torch.linalg.lu_solve.html | pytorch docs |
torch.sgntorch.sgn(input, , out=None) -> Tensor
This function is an extension of torch.sign() to complex tensors.
It computes a new tensor whose elements have the same angles as the
corresponding elements of "input" and absolute values (i.e.
magnitudes) of one for complex tensors and is equivalent to
tor... | https://pytorch.org/docs/stable/generated/torch.sgn.html | pytorch docs |
torch.matrix_powertorch.matrix_power(input, n, *, out=None) -> Tensor
Alias for "torch.linalg.matrix_power()" | https://pytorch.org/docs/stable/generated/torch.matrix_power.html | pytorch docs |
torch.Tensor.storage_typeTensor.storage_type() -> type
Returns the type of the underlying storage. | https://pytorch.org/docs/stable/generated/torch.Tensor.storage_type.html | pytorch docs |
torch.cuda.OutOfMemoryErrorexception torch.cuda.OutOfMemoryError
Exception raised when CUDA is out of memory | https://pytorch.org/docs/stable/generated/torch.cuda.OutOfMemoryError.html | pytorch docs |
torch.as_tensortorch.as_tensor(data, dtype=None, device=None) -> Tensor
Converts "data" into a tensor, sharing data and preserving autograd
history if possible.
If "data" is already a tensor with the requested dtype and device
then "data" itself is returned, but if "data" is a tensor with a
different dty... | https://pytorch.org/docs/stable/generated/torch.as_tensor.html | pytorch docs |
"data".
* device ("torch.device", optional) -- the device of the
constructed tensor. If None and data is a tensor then the
device of data is used. If None and data is not a tensor then
the result tensor is constructed on the CPU.
Example:
>>> a = numpy.array([1, 2, 3])
>>> t... | https://pytorch.org/docs/stable/generated/torch.as_tensor.html | pytorch docs |
torch.nn.functional.softplustorch.nn.functional.softplus(input, beta=1, threshold=20) -> Tensor
Applies element-wise, the function \text{Softplus}(x) =
\frac{1}{\beta} * \log(1 + \exp(\beta * x)).
For numerical stability the implementation reverts to the linear
function when input \times \beta > threshold.
... | https://pytorch.org/docs/stable/generated/torch.nn.functional.softplus.html | pytorch docs |
torch.tiletorch.tile(input, dims) -> Tensor
Constructs a tensor by repeating the elements of "input". The
"dims" argument specifies the number of repetitions in each
dimension.
If "dims" specifies fewer dimensions than "input" has, then ones
are prepended to "dims" until all dimensions are specified. For... | https://pytorch.org/docs/stable/generated/torch.tile.html | pytorch docs |
Example:
>>> x = torch.tensor([1, 2, 3])
>>> x.tile((2,))
tensor([1, 2, 3, 1, 2, 3])
>>> y = torch.tensor([[1, 2], [3, 4]])
>>> torch.tile(y, (2, 2))
tensor([[1, 2, 1, 2],
[3, 4, 3, 4],
[1, 2, 1, 2],
[3, 4, 3, 4]]) | https://pytorch.org/docs/stable/generated/torch.tile.html | pytorch docs |
Conv3dclass torch.nn.Conv3d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True, padding_mode='zeros', device=None, dtype=None)
Applies a 3D convolution over an input signal composed of several
input planes.
In the simplest case, the output value of the layer with input... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
giving the amount of implicit padding applied on both sides.
* "dilation" controls the spacing between the kernel points; also
known as the à trous algorithm. It is harder to describe, but
this link has a nice visualization of what "dilation" does.
* "groups" controls the connections between inputs and... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
either be:
* a single "int" -- in which case the same value is used for the
depth, height and width dimension
* a "tuple" of three ints -- in which case, the first int is
used for the depth dimension, the second int for the height
dimension and the third int for the width dimension
... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
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:
"padding='valid'" is the same as no padding. "padding='same'"
pads the input so the output has the shape as the i... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
padding_mode (str, optional) -- "'zeros'",
"'reflect'", "'replicate'" or "'circular'". Default: "'zeros'"
dilation (int or tuple, optional) -- Spacing
between kernel elements. Default: 1
groups (int, optional) -- Number of blocked
connections from input channels to output channels. Default: 1
bias (boo... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
\text{padding}[1] - \text{dilation}[1] \times
(\text{kernel_size}[1] - 1) - 1}{\text{stride}[1]} +
1\right\rfloor
W_{out} = \left\lfloor\frac{W_{in} + 2 \times
\text{padding}[2] - \text{dilation}[2] \times
(\text{kernel_size}[2] - 1) - 1}{\text{stride}[... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
\sqrt{k}) where k = \frac{groups}{C_\text{in} *
\prod_{i=0}^{2}\text{kernel_size}[i]}
Examples:
>>> # With square kernels and equal stride
>>> m = nn.Conv3d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and with padding
>>> m = nn.Conv3d(16, 33, (3, 5, 2), stride=(2... | https://pytorch.org/docs/stable/generated/torch.nn.Conv3d.html | pytorch docs |
torch.Tensor.cudaTensor.cuda(device=None, non_blocking=False, memory_format=torch.preserve_format) -> Tensor
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:
* de... | https://pytorch.org/docs/stable/generated/torch.Tensor.cuda.html | pytorch docs |
torch.Tensor.exponential_Tensor.exponential_(lambd=1, *, generator=None) -> Tensor
Fills "self" tensor with elements drawn from the exponential
distribution:
f(x) = \lambda e^{-\lambda x} | https://pytorch.org/docs/stable/generated/torch.Tensor.exponential_.html | pytorch docs |
torch.randn_liketorch.randn_like(input, , dtype=None, layout=None, device=None, requires_grad=False, memory_format=torch.preserve_format) -> Tensor
Returns a tensor with the same size as "input" that is filled with
random numbers from a normal distribution with mean 0 and variance
1. "torch.randn_like(input)" ... | https://pytorch.org/docs/stable/generated/torch.randn_like.html | pytorch docs |
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... | https://pytorch.org/docs/stable/generated/torch.randn_like.html | pytorch docs |
torch.nn.functional.poisson_nll_losstorch.nn.functional.poisson_nll_loss(input, target, log_input=True, full=False, size_average=None, eps=1e-08, reduce=None, reduction='mean')
Poisson negative log likelihood loss.
See "PoissonNLLLoss" for details.
Parameters:
* input (Tensor) -- expectation of underlyin... | https://pytorch.org/docs/stable/generated/torch.nn.functional.poisson_nll_loss.html | pytorch docs |
\log(2 * \pi * \text{target}).
* size_average (bool, optional) -- Deprecated (see
"reduction"). By default, the losses are averaged over each
loss element in the batch. Note that for some losses, there
multiple elements per sample. If the field "size_average" is
set to "False", the... | https://pytorch.org/docs/stable/generated/torch.nn.functional.poisson_nll_loss.html | pytorch docs |
to apply to the output: "'none'" | "'mean'" | "'sum'".
"'none'": no reduction will be applied, "'mean'": the sum of
the output will be divided by the number of elements in the
output, "'sum'": the output will be summed. Note:
"size_average" and "reduce" are in the process of being
... | https://pytorch.org/docs/stable/generated/torch.nn.functional.poisson_nll_loss.html | pytorch docs |
torch.foreach_log1p_torch._foreach_log1p(self: List[Tensor]) -> None
Apply "torch.log1p()" to each Tensor of the input list. | https://pytorch.org/docs/stable/generated/torch._foreach_log1p_.html | pytorch docs |
torch.maxtorch.max(input) -> Tensor
Returns the maximum value of all elements in the "input" tensor.
Warning:
This function produces deterministic (sub)gradients unlike
"max(dim=0)"
Parameters:
input (Tensor) -- the input tensor.
Example:
>>> a = torch.randn(1, 3)
>>> a
ten... | https://pytorch.org/docs/stable/generated/torch.max.html | pytorch docs |
Note:
If there are multiple maximal values in a reduced row then the
indices of the first maximal value are returned.
Parameters:
* input (Tensor) -- the input tensor.
* dim (int) -- the dimension to reduce.
* keepdim (bool) -- whether the output tensor has "dim"
retained or not. ... | https://pytorch.org/docs/stable/generated/torch.max.html | pytorch docs |
torch.Tensor.storageTensor.storage() -> torch.TypedStorage
Returns the underlying "TypedStorage".
Warning:
"TypedStorage" is deprecated. It will be removed in the future,
and "UntypedStorage" will be the only storage class. To access
the "UntypedStorage" directly, use "Tensor.untyped_storage()". | https://pytorch.org/docs/stable/generated/torch.Tensor.storage.html | pytorch docs |
torch.Tensor.crossTensor.cross(other, dim=None) -> Tensor
See "torch.cross()" | https://pytorch.org/docs/stable/generated/torch.Tensor.cross.html | pytorch docs |
torch.corrcoeftorch.corrcoef(input) -> Tensor
Estimates the Pearson product-moment correlation coefficient matrix
of the variables given by the "input" matrix, where rows are the
variables and columns are the observations.
Note:
The correlation coefficient matrix R is computed using the
covariance... | https://pytorch.org/docs/stable/generated/torch.corrcoef.html | pytorch docs |
Example:
>>> x = torch.tensor([[0, 1, 2], [2, 1, 0]])
>>> torch.corrcoef(x)
tensor([[ 1., -1.],
[-1., 1.]])
>>> x = torch.randn(2, 4)
>>> x
tensor([[-0.2678, -0.0908, -0.3766, 0.2780],
[-0.5812, 0.1535, 0.2387, 0.2350]])
>>> torch.corrcoef(x)
... | https://pytorch.org/docs/stable/generated/torch.corrcoef.html | pytorch docs |
torch.bitwise_left_shifttorch.bitwise_left_shift(input, other, , out=None) -> Tensor
Computes the left arithmetic shift of "input" by "other" bits. The
input tensor must be of integral type. This operator supports
broadcasting to a common shape and type promotion.
The operation applied is:
\text{out}_... | https://pytorch.org/docs/stable/generated/torch.bitwise_left_shift.html | pytorch docs |
torch.heavisidetorch.heaviside(input, values, , out=None) -> Tensor
Computes the Heaviside step function for each element in "input".
The Heaviside step function is defined as:
\text{{heaviside}}(input, values) = \begin{cases} 0, &
\text{if input < 0}\ values, & \text{if input == 0}\
1, ... | https://pytorch.org/docs/stable/generated/torch.heaviside.html | pytorch docs |
float16_dynamic_qconfigtorch.quantization.qconfig.float16_dynamic_qconfig
alias of QConfig(activation=functools.partial(,
dtype=torch.float16, is_dynamic=True){},
weight=functools.partial(,
dtype=torch.float16){}) | https://pytorch.org/docs/stable/generated/torch.quantization.qconfig.float16_dynamic_qconfig.html | pytorch docs |
torch.cuda.get_allocator_backendtorch.cuda.get_allocator_backend()
Returns a string describing the active allocator backend as set by
"PYTORCH_CUDA_ALLOC_CONF". Currently available backends are
"native" (PyTorch's native caching allocator) and
cudaMallocAsync` (CUDA's built-in asynchronous allocator).
No... | https://pytorch.org/docs/stable/generated/torch.cuda.get_allocator_backend.html | pytorch docs |
torch.Tensor.cholesky_solveTensor.cholesky_solve(input2, upper=False) -> Tensor
See "torch.cholesky_solve()" | https://pytorch.org/docs/stable/generated/torch.Tensor.cholesky_solve.html | pytorch docs |
torch.nn.functional.upsampletorch.nn.functional.upsample(input, size=None, scale_factor=None, mode='nearest', align_corners=None)
Upsamples the input to either the given "size" or the given
"scale_factor"
Warning:
This function is deprecated in favor of
"torch.nn.functional.interpolate()". This is eq... | https://pytorch.org/docs/stable/generated/torch.nn.functional.upsample.html | pytorch docs |
Parameters:
* input (Tensor) -- the input tensor
* size (int or Tuple[int] or Tuple[int,
int] or Tuple[int, int, int]) -- output
spatial size.
* scale_factor (float or Tuple[float]) --
multiplier for spatial size. Has to match input size if it is
a tuple.
* mode (... | https://pytorch.org/docs/stable/generated/torch.nn.functional.upsample.html | pytorch docs |
of their corner pixels, and the interpolation uses edge value
padding for out-of-boundary values, making this operation
independent of input size when "scale_factor" is kept the
same. This only has an effect when "mode" is "'linear'",
"'bilinear'", "'bicubic'" or "'trilinear'". Default: ... | https://pytorch.org/docs/stable/generated/torch.nn.functional.upsample.html | pytorch docs |
"align_corners = False". See "Upsample" for concrete examples on
how this affects the outputs. | https://pytorch.org/docs/stable/generated/torch.nn.functional.upsample.html | pytorch docs |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.