shrinath-suresh/blogs-docs-splitted huggingface dataset:
torch.all
torch.all(input) -> Tensor
Tests if all elements in "input" evaluate to True.
Note:
 This function matches the behaviour of NumPy in returning output
 of dtype *bool* for all supported dtypes except *uint8*. For
 *uint8* the dtype of output is *uint8* itself.

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

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

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

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> a = torch.rand(4, 2).bool()
  >>> a
  tensor([[True, True],
          [True, False],
          [True, True],
          [True, True]], dtype=torch.bool)
  >>> torch.all(a, dim=1)
  tensor([ True, False,  True,  True], dtype=torch.bool)
  >>> torch.all(a, dim=0)
  tensor([ True, False], dtype=torch.bool)
torch.lu_solve
torch.lu_solve(b, LU_data, LU_pivots, *, out=None) -> Tensor
Returns the LU solve of the linear system Ax = b using the
   partially pivoted LU factorization of A from "lu_factor()".
This function supports "float", "double", "cfloat" and "cdouble"
   dtypes for "input".
Warning:
 "torch.lu_solve()" is deprecated in favor of
 "torch.linalg.lu_solve()". "torch.lu_solve()" will be removed in
 a future PyTorch release. "X = torch.lu_solve(B, LU, pivots)"
 should be replaced with

    X = linalg.lu_solve(LU, pivots, B)

Parameters:
      * b (Tensor) -- the RHS tensor of size (*, m, k), where *
        is zero or more batch dimensions.
  * **LU_data** (*Tensor*) -- the pivoted LU factorization of A
    from "lu_factor()" of size (*, m, m), where * is zero or more
    batch dimensions.

  * **LU_pivots** (*IntTensor*) -- the pivots of the LU
    factorization from "lu_factor()" of size (*, m), where * is
zero or more batch dimensions. The batch dimensions of
        "LU_pivots" must be equal to the batch dimensions of
        "LU_data".
Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> A = torch.randn(2, 3, 3)
  >>> b = torch.randn(2, 3, 1)
  >>> LU, pivots = torch.linalg.lu_factor(A)
  >>> x = torch.lu_solve(b, LU, pivots)
  >>> torch.dist(A @ x, b)
  tensor(1.00000e-07 *
         2.8312)
torch.cuda.comm.broadcast
torch.cuda.comm.broadcast(tensor, devices=None, *, out=None)
Broadcasts a tensor to specified GPU devices.
Parameters:
      * tensor (Tensor) -- tensor to broadcast. Can be on CPU or
        GPU.
  * **devices** (*Iterable**[**torch.device**, **str** or
    **int**]**, **optional*) -- an iterable of GPU devices, among
    which to broadcast.

  * **out** (*Sequence**[**Tensor**]**, **optional**, **keyword-
    only*) -- the GPU tensors to store output results.

Note:
 Exactly one of "devices" and "out" must be specified.

Returns:
      * If "devices" is specified,
           a tuple containing copies of "tensor", placed on "devices".
  * If "out" is specified,
       a tuple containing "out" tensors, each containing a copy of
       "tensor".
torch.fmod
torch.fmod(input, other, *, out=None) -> Tensor
Applies C++'s std::fmod entrywise. The result has the same sign as
   the dividend "input" and its absolute value is less than that of
   "other".
This function may be defined in terms of "torch.div()" as
  torch.fmod(a, b) == a - a.div(b, rounding_mode="trunc") * b

Supports broadcasting to a common shape, type promotion, and
   integer and float inputs.
Note:
 When the divisor is zero, returns "NaN" for floating point dtypes
 on both CPU and GPU; raises "RuntimeError" for integer division
 by zero on CPU; Integer division by zero on GPU may return any
 value.

Note:
 Complex inputs are not supported. In some cases, it is not
 mathematically possible to satisfy the definition of a modulo
 operation with complex numbers.

See also:
 "torch.remainder()" which implements Python's modulus operator.
 This one is defined using division rounding down the result.

Parameters:
Parameters:
      * input (Tensor) -- the dividend
  * **other** (*Tensor** or **Scalar*) -- the divisor

Keyword Arguments:
      out (Tensor, optional) -- the output tensor.
Example:
  >>> torch.fmod(torch.tensor([-3., -2, -1, 1, 2, 3]), 2)
  tensor([-1., -0., -1.,  1.,  0.,  1.])
  >>> torch.fmod(torch.tensor([1, 2, 3, 4, 5]), -1.5)
  tensor([1.0000, 0.5000, 0.0000, 1.0000, 0.5000])
torch.argmin
torch.argmin(input, dim=None, keepdim=False) -> LongTensor
Returns the indices of the minimum value(s) of the flattened tensor
   or along a dimension
This is the second value returned by "torch.min()". See its
   documentation for the exact semantics of this method.
Note:
 If there are multiple minimal values then the indices of the
 first minimal value are returned.

Parameters:
      * input (Tensor) -- the input tensor.
  * **dim** (*int*) -- the dimension to reduce. If "None", the
    argmin of the flattened input is returned.

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

Example:
  >>> a = torch.randn(4, 4)
  >>> a
  tensor([[ 0.1139,  0.2254, -0.1381,  0.3687],
          [ 1.0100, -1.1975, -0.0102, -0.4732],
          [-0.9240,  0.1207, -0.7506, -1.0213],
          [ 1.7809, -1.2960,  0.9384,  0.1438]])
  >>> torch.argmin(a)
  tensor(13)
Conv1d
class torch.nn.Conv1d(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 1D convolution over an input signal composed of several
   input planes.
In the simplest case, the output value of the layer with input size
   (N, C_{\text{in}}, L) and output (N, C_{\text{out}},
   L_{\text{out}}) can be precisely described as:
  \text{out}(N_i, C_{\text{out}_j}) =
  \text{bias}(C_{\text{out}_j}) + \sum_{k = 0}^{C_{in} - 1}
  \text{weight}(C_{\text{out}_j}, k) \star \text{input}(N_i, k)

where \star is the valid cross-correlation operator, N is a batch
   size, C denotes a number of channels, L is a length of signal
   sequence.
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, a single
number or a one-element tuple.


"padding" controls the amount of padding applied to the input. It
     can be either a string {'valid', 'same'} or a tuple of ints
     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 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}}).
Note:
 When *groups == in_channels* and *out_channels == K *
 in_channels*, where *K* is a positive integer, this operation is
 also known as a "depthwise convolution".In other words, for an
 input of size (N, C_{in}, L_{in}), a depthwise convolution with a
 depthwise multiplier *K* can be performed with the arguments
 (C_\text{in}=C_\text{in}, C_\text{out}=C_\text{in} \times
 \text{K}, ..., \text{groups}=C_\text{in}).

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:
Note:
 "padding='valid'" is the same as no padding. "padding='same'"
 pads the input so the output has the shape as the input. However,
 this mode doesn't support any stride values other than 1.

Note:
 This module supports complex data types i.e. "complex32,
 complex64, complex128".

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**, **tuple** or **str**, **optional*) --
    Padding added to both sides of the input. Default: 0

  * **padding_mode** (*str**, **optional*) -- "'zeros'",
    "'reflect'", "'replicate'" or "'circular'". Default: "'zeros'"

  * **dilation** (*int** or **tuple**, **optional*) -- Spacing
between kernel elements. Default: 1
  * **groups** (*int**, **optional*) -- Number of blocked
    connections from input channels to output channels. Default: 1

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

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

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

Variables:
      * weight (Tensor) -- the learnable weights of the module
        of shape (\text{out_channels},
        \frac{\text{in_channels}}{\text{groups}},
        \text{kernel_size}). The values of these weights are sampled
        from \mathcal{U}(-\sqrt{k}, \sqrt{k}) where k =
        \frac{groups}{C_\text{in} * \text{kernel_size}}
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{in} *
        \text{kernel_size}}

Examples:
  >>> m = nn.Conv1d(16, 33, 3, stride=2)
  >>> input = torch.randn(20, 16, 50)
  >>> output = m(input)
JitScalarType
class torch.onnx.JitScalarType(value)
Scalar types defined in torch.
Use "JitScalarType" to convert from torch and JIT scalar types to
   ONNX scalar types.
-[ Examples ]-



JitScalarType.from_value(torch.ones(1, 2)).onnx_type()
   TensorProtoDataType.FLOAT
JitScalarType.from_value(torch_c_value_with_type_float).onnx_type()
   TensorProtoDataType.FLOAT
JitScalarType.from_dtype(torch.get_default_dtype).onnx_type()
   TensorProtoDataType.FLOAT



dtype()
  Convert a JitScalarType to a torch dtype.

  Return type:
     *dtype*

classmethod from_dtype(dtype)
  Convert a torch dtype to JitScalarType.

  Note: DO NOT USE this API when *dtype* comes from a
  *torch._C.Value.type()* calls.
     A "RuntimeError: INTERNAL ASSERT FAILED at
     "../aten/src/ATen/core/jit_type_base.h" can be raised in
     several scenarios where shape info is not present. Instead
     use *from_value* API which is safer.
use from_value API which is safer.
  Parameters:
     **dtype** (*Optional**[**dtype**]*) -- A torch.dtype to
     create a JitScalarType from

  Returns:
     JitScalarType

  Raises:
     **OnnxExporterError** -- if dtype is not a valid torch.dtype
     or if it is None.

  Return type:
     *JitScalarType*

classmethod from_value(value, default=None)
  Create a JitScalarType from an value's scalar type.

  Parameters:
     * **value** (*Union**[**None**, **Value**, **Tensor**]*) --
       An object to fetch scalar type from.

     * **default** -- The JitScalarType to return if a valid
       scalar cannot be fetched from value

  Returns:
     JitScalarType.

  Raises:
     * **OnnxExporterError** -- if value does not have a valid
       scalar type and default is None.

     * **SymbolicValueError** -- when value.type()'s info are
       empty and default is None

  Return type:
Return type:
         JitScalarType
onnx_compatible()
  Return whether this JitScalarType is compatible with ONNX.

  Return type:
     bool

onnx_type()
  Convert a JitScalarType to an ONNX data type.

  Return type:
     *TensorProtoDataType*

scalar_name()
  Convert a JitScalarType to a JIT scalar type name.

  Return type:
     *Literal*['Byte', 'Char', 'Double', 'Float', 'Half', 'Int',
     'Long', 'Short', 'Bool', 'ComplexHalf', 'ComplexFloat',
     'ComplexDouble', 'QInt8', 'QUInt8', 'QInt32', 'BFloat16',
     'Undefined']

torch_name()
  Convert a JitScalarType to a torch type name.

  Return type:
     *Literal*['bool', 'uint8_t', 'int8_t', 'double', 'float',
     'half', 'int', 'int64_t', 'int16_t', 'complex32',
     'complex64', 'complex128', 'qint8', 'quint8', 'qint32',
     'bfloat16']
torch.cuda.comm.scatter
torch.cuda.comm.scatter(tensor, devices=None, chunk_sizes=None, dim=0, streams=None, *, out=None)
Scatters tensor across multiple GPUs.
Parameters:
      * tensor (Tensor) -- tensor to scatter. Can be on CPU or
        GPU.
  * **devices** (*Iterable**[**torch.device**, **str** or
    **int**]**, **optional*) -- an iterable of GPU devices, among
    which to scatter.

  * **chunk_sizes** (*Iterable**[**int**]**, **optional*) -- sizes
    of chunks to be placed on each device. It should match
    "devices" in length and sums to "tensor.size(dim)". If not
    specified, "tensor" will be divided into equal chunks.

  * **dim** (*int**, **optional*) -- A dimension along which to
    chunk "tensor". Default: "0".

  * **streams** (*Iterable**[**Stream**]**, **optional*) -- an
    iterable of Streams, among which to execute the scatter. If
    not specified, the default stream will be utilized.
out (Sequence[Tensor], optional, keyword-
        only) -- the GPU tensors to store output results. Sizes of
        these tensors must match that of "tensor", except for "dim",
        where the total size must sum to "tensor.size(dim)".

Note:
 Exactly one of "devices" and "out" must be specified. When "out"
 is specified, "chunk_sizes" must not be specified and will be
 inferred from sizes of "out".

Returns:
      * If "devices" is specified,
           a tuple containing chunks of "tensor", placed on "devices".
  * If "out" is specified,
       a tuple containing "out" tensors, each containing a chunk
       of "tensor".
torch.sparse.log_softmax
torch.sparse.log_softmax(input, dim, *, dtype=None) -> Tensor
Applies a softmax function followed by logarithm.
See "softmax" for more details.
Parameters:
      * input (Tensor) -- input
  * **dim** (*int*) -- A dimension along which softmax will be
    computed.

  * **dtype** ("torch.dtype", optional) -- the desired data type
    of returned tensor.  If specified, the input tensor is casted
    to "dtype" before the operation is performed. This is useful
    for preventing data type overflows. Default: None
torch.inner
torch.inner(input, other, *, out=None) -> Tensor
Computes the dot product for 1D tensors. For higher dimensions,
   sums the product of elements from "input" and "other" along their
   last dimension.
Note:
 If either "input" or "other" is a scalar, the result is
 equivalent to *torch.mul(input, other)*.If both "input" and
 "other" are non-scalars, the size of their last dimension must
 match and the result is equivalent to *torch.tensordot(input,
 other, dims=([-1], [-1]))*

Parameters:
      * input (Tensor) -- First input tensor
  * **other** (*Tensor*) -- Second input tensor

Keyword Arguments:
      out (Tensor, optional) -- Optional output tensor to
      write result into. The output shape is input.shape[:-1] +
      other.shape[:-1].
Example:
  # Dot product
  >>> torch.inner(torch.tensor([1, 2, 3]), torch.tensor([0, 2, 1]))
  tensor(7)

  # Multidimensional input tensors
Multidimensional input tensors
  >>> a = torch.randn(2, 3)
  >>> a
  tensor([[0.8173, 1.0874, 1.1784],
          [0.3279, 0.1234, 2.7894]])
  >>> b = torch.randn(2, 4, 3)
  >>> b
  tensor([[[-0.4682, -0.7159,  0.1506],
          [ 0.4034, -0.3657,  1.0387],
          [ 0.9892, -0.6684,  0.1774],
          [ 0.9482,  1.3261,  0.3917]],

          [[ 0.4537,  0.7493,  1.1724],
          [ 0.2291,  0.5749, -0.2267],
          [-0.7920,  0.3607, -0.3701],
          [ 1.3666, -0.5850, -1.7242]]])
  >>> torch.inner(a, b)
  tensor([[[-0.9837,  1.1560,  0.2907,  2.6785],
          [ 2.5671,  0.5452, -0.6912, -1.5509]],

          [[ 0.1782,  2.9843,  0.7366,  1.5672],
          [ 3.5115, -0.4864, -1.2476, -4.4337]]])

  # Scalar input
  >>> torch.inner(a, torch.tensor(2))
  tensor([[1.6347, 2.1748, 2.3567],
          [0.6558, 0.2469, 5.5787]])
LSTMCell
class torch.nn.LSTMCell(input_size, hidden_size, bias=True, device=None, dtype=None)
A long short-term memory (LSTM) cell.
  \begin{array}{ll} i = \sigma(W_{ii} x + b_{ii} + W_{hi} h +
  b_{hi}) \\ f = \sigma(W_{if} x + b_{if} + W_{hf} h + b_{hf}) \\
  g = \tanh(W_{ig} x + b_{ig} + W_{hg} h + b_{hg}) \\ o =
  \sigma(W_{io} x + b_{io} + W_{ho} h + b_{ho}) \\ c' = f * c + i
  * g \\ h' = o * \tanh(c') \\ \end{array}

where \sigma is the sigmoid function, and * is the Hadamard
   product.
Parameters:
      * input_size (int) -- The number of expected features in
        the input x
  * **hidden_size** (*int*) -- The number of features in the
    hidden state *h*

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

Inputs: input, (h_0, c_0)
      * input of shape (batch, input_size) or (input_size):
        tensor containing input features
tensor containing input features
  * **h_0** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the initial hidden state

  * **c_0** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the initial cell state

    If *(h_0, c_0)* is not provided, both **h_0** and **c_0**
    default to zero.

Outputs: (h_1, c_1)
      * h_1 of shape (batch, hidden_size) or (hidden_size):
        tensor containing the next hidden state
  * **c_1** of shape *(batch, hidden_size)* or *(hidden_size)*:
    tensor containing the next cell state

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

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

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

On certain ROCm devices, when using float16 inputs this module will
   use different precision for backward.
Examples:
  >>> rnn = nn.LSTMCell(10, 20)  # (input_size, hidden_size)
  >>> input = torch.randn(2, 3, 10)  # (time_steps, batch, input_size)
  >>> hx = torch.randn(3, 20)  # (batch, hidden_size)
  >>> cx = torch.randn(3, 20)
  >>> output = []
  >>> for i in range(input.size()[0]):
  ...     hx, cx = rnn(input[i], (hx, cx))
  ...     output.append(hx)
  >>> output = torch.stack(output, dim=0)
conv3d
class torch.ao.nn.quantized.functional.conv3d(input, weight, bias, stride=1, padding=0, dilation=1, groups=1, padding_mode='zeros', scale=1.0, zero_point=0, dtype=torch.quint8)
Applies a 3D convolution over a quantized 3D input composed of
   several input planes.
See "Conv3d" for details and output shape.
Parameters:
      * input -- quantized input tensor of shape (\text{minibatch}
        , \text{in_channels} , iD , iH , iW)
  * **weight** -- quantized filters of shape (\text{out\_channels}
    , \frac{\text{in\_channels}}{\text{groups}} , kD , kH , kW)

  * **bias** -- **non-quantized** bias tensor of shape
    (\text{out\_channels}). The tensor type must be *torch.float*.

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

  * **padding** -- implicit paddings on both sides of the input.
    Can be a single number or a tuple *(padD, padH, padW)*.
    Default: 0
Default: 0
  * **dilation** -- the spacing between kernel elements. Can be a
    single number or a tuple *(dD, dH, dW)*. Default: 1

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

  * **padding_mode** -- the padding mode to use. Only "zeros" is
    supported for quantized convolution at the moment. Default:
    "zeros"

  * **scale** -- quantization scale for the output. Default: 1.0

  * **zero_point** -- quantization zero_point for the output.
    Default: 0

  * **dtype** -- quantization data type to use. Default:
    "torch.quint8"

Examples:
  >>> from torch.ao.nn.quantized import functional as qF
  >>> filters = torch.randn(8, 4, 3, 3, 3, dtype=torch.float)
  >>> inputs = torch.randn(1, 4, 5, 5, 5, dtype=torch.float)
  >>> bias = torch.randn(8, dtype=torch.float)
  >>>
  >>> scale, zero_point = 1.0, 0
  >>> dtype_inputs = torch.quint8
dtype_inputs = torch.quint8
      >>> dtype_filters = torch.qint8
      >>>
      >>> q_filters = torch.quantize_per_tensor(filters, scale, zero_point, dtype_filters)
      >>> q_inputs = torch.quantize_per_tensor(inputs, scale, zero_point, dtype_inputs)
      >>> qF.conv3d(q_inputs, q_filters, bias, padding=1, scale=scale, zero_point=zero_point)
torch.nn.utils.prune.is_pruned
torch.nn.utils.prune.is_pruned(module)
Check whether "module" is pruned by looking for "forward_pre_hooks"
   in its modules that inherit from the "BasePruningMethod".
Parameters:
      module (nn.Module) -- object that is either pruned or
      unpruned
Returns:
      binary answer to whether "module" is pruned.
-[ Examples ]-



from torch.nn.utils import prune
m = nn.Linear(5, 7)
print(prune.is_pruned(m))
   False
prune.random_unstructured(m, name='weight', amount=0.2)
print(prune.is_pruned(m))
   True
max_pool1d
class torch.ao.nn.quantized.functional.max_pool1d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False)
Applies a 1D max pooling over a quantized input signal composed of
   several quantized input planes.
Note:
 The input quantization parameters are propagated to the output.

See "MaxPool1d" for details.
torch.add
torch.add(input, other, *, alpha=1, out=None) -> Tensor
Adds "other", scaled by "alpha", to "input".
  \text{{out}}_i = \text{{input}}_i + \text{{alpha}} \times
  \text{{other}}_i

Supports broadcasting to a common shape, type promotion, and
   integer, float, and complex inputs.
Parameters:
      * input (Tensor) -- the input tensor.
  * **other** (*Tensor** or **Number*) -- the tensor or number to
    add to "input".

Keyword Arguments:
      * alpha (Number) -- the multiplier for "other".
  * **out** (*Tensor**, **optional*) -- the output tensor.

Examples:
  >>> a = torch.randn(4)
  >>> a
  tensor([ 0.0202,  1.0985,  1.3506, -0.6056])
  >>> torch.add(a, 20)
  tensor([ 20.0202,  21.0985,  21.3506,  19.3944])

  >>> b = torch.randn(4)
  >>> b
  tensor([-0.9732, -0.3497,  0.6245,  0.4022])
  >>> c = torch.randn(4, 1)
  >>> c
  tensor([[ 0.3743],
          [-1.7724],
tensor([[ 0.3743],
              [-1.7724],
              [-0.5811],
              [-0.8017]])
      >>> torch.add(b, c, alpha=10)
      tensor([[  2.7695,   3.3930,   4.3672,   4.1450],
              [-18.6971, -18.0736, -17.0994, -17.3216],
              [ -6.7845,  -6.1610,  -5.1868,  -5.4090],
              [ -8.9902,  -8.3667,  -7.3925,  -7.6147]])