Shortcuts

Torch Script

Torch Script is a way to create serializable and optimizable models from PyTorch code. Any code written in Torch Script can be saved from your Python process and loaded in a process where there is no Python dependency.

We provide tools to incrementally transition a model from being a pure Python program to a Torch Script program that can be run independently from Python, for instance, in a standalone C++ program. This makes it possible to train models in PyTorch using familiar tools and then export the model to a production environment where it is not a good idea to run models as Python programs for performance and multi-threading reasons.

Creating Torch Script Code

class torch.jit.ScriptModule(optimize=True)[source]

The core data structure in Torch Script is the ScriptModule. It is an analogue of torch’s nn.Module and represents an entire model as a tree of submodules. Like normal modules, each individual module in a ScriptModule can have submodules, parameters, and methods. In nn.Modules methods are implemented as Python functions, but in ScriptModules methods typically implemented as Torch Script functions, a statically-typed subset of Python that contains all of PyTorch’s built-in Tensor operations. This difference allows your ScriptModules code to run without the need for a Python interpreter.

ScriptModules and the Torch Script functions inside of them can be created in two ways:

Tracing:

Using torch.jit.trace, you can take an existing module or python function, provide example inputs, and we run the function, recording the operations performed on all the tensors. We turn the resulting recording into a Torch Script method that is installed as the forward method of a ScriptModule. This module also contains any parameters that the original module had as well.

Example:

import torch
def foo(x, y):
    return 2*x + y
traced_foo = torch.jit.trace(foo, (torch.rand(3), torch.rand(3)))

Note

Tracing a function will produce a ScriptModule with a single forward method that implements that function, and that contains no parameters.

Example:

import torch
import torchvision
traced_net = torch.jit.trace(torchvision.models.resnet18(),
                             torch.rand(1, 3, 224, 224))

Note

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 just inlines configuration decisions. But sometimes the control-flow is actually part of the model itself. For instance, a beam search in sequence-to-sequence translation is a loop over the (varying) sequence length of inputs.
  • 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.

Scripting:

You can write Torch Script code directly using Python syntax. You do this using the torch.jit.script annotation (for functions) or torch.jit.script_method annotation (for methods) on subclasses of ScriptModule. With this annotation the body of the annotated function is directly translated into Torch Script. Torch Script itself is a subset of the Python language, so not all features in python work, but we provide enough functionality to compute on tensors and do control-dependent operations.

Example:

import torch
@torch.jit.script
def foo(x, y):
    if x.max() > y.max():
        r = x
    else:
        r = y
    return r

Note

A script function annotation will construct a ScriptModule with a single forward method that implements that function, and that contains no parameters.

Example:

import torch
class MyModule(torch.jit.ScriptModule):
    def __init__(self, N, M):
        super(MyModule, self).__init__()
        self.weight = torch.nn.Parameter(torch.rand(N, M))

    @torch.jit.script_method
    def forward(self, input):
        return self.weight.mv(input)

Example:

import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.jit import ScriptModule, script_method, trace

class MyScriptModule(ScriptModule):
    def __init__(self):
        super(MyScriptModule, self).__init__()
        # trace produces a ScriptModule's conv1 and conv2
        self.conv1 = trace(nn.Conv2d(1, 20, 5), torch.rand(1, 1, 16, 16))
        self.conv2 = trace(nn.Conv2d(20, 20, 5), torch.rand(1, 20, 16, 16))

    @script_method
    def forward(self, input):
      input = F.relu(self.conv1(input))
      input = F.relu(self.conv2(input))
      return input
save(filename)

Save an offline version of this module for use in a separate process. The saved module serializes all of the methods and parameters of this module. It can be loaded into the C++ API using torch::jit::load(filename) or into the Python API with torch.jit.load(filename).

To be able to save a module, it must not make any calls to native python functions. This means that all submodules must be subclasses of ScriptModules as well.

Danger

All modules, no matter their device, are always loaded onto the CPU during loading. This is different from torch.load()’s semantics and may change in the future.

torch.jit.load(f)[source]

Load a ScriptModule previously saved with save

Danger

All previously saved modules, no matter their device, are always loaded onto the CPU. This is different from torch.load()’s semantics and may change in the future.

Parameters:f – a file-like object (has to implement read, readline, tell, and seek), or a string containing a file name
Returns:A ScriptModule object.

Example

>>> torch.jit.load('scriptmodule.pt')
# Load ScriptModule from io.BytesIO object
>>> with open('scriptmodule.pt', 'rb') as f:
        buffer = io.BytesIO(f.read())
>>> torch.jit.load(buffer)
torch.jit.trace(func, example_inputs, optimize=True, check_trace=True, check_inputs=None, check_tolerance=1e-05)[source]

Trace a function and return an executable trace that will be optimized using just-in-time compilation.

Warning

Tracing only correctly records functions and modules which are not data dependent (e.g., have conditionals on data in tensors) and do not have any untracked external dependencies (e.g., perform input/output or access global variables). 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. arguments and returns to func must be Tensors or (possibly nested) tuples that contain tensors.
  • example_inputs (tuple) – a tuple of example inputs that will be passed to the function while tracing. 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
Keyword Arguments:
 
  • optimize (bool, optional) – whether or not to apply optimizations. Default: True.
  • 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 seet of input arguments that would be specified in args. 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 args is 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.
Returns:

A ScriptModule object with a single forward() method containing the traced code. When func is a torch.nn.Module, the returned ScriptModule will have the same set of sub-modules and parameters as func.

Example

>>> def f(x):
...     return x * 2
>>> traced_f = torch.jit.trace(f, torch.rand(1))

Mixing Tracing and Scripting

In many cases either tracing or script is an easier approach for converting a model. We allow you to compose tracing and scripting to suit the particular requirements of a part of a model.

Scripted functions can call traced ones. This is particularly useful when you need to use control-flow around a simple feed-forward model. For instance the beam search of a sequence to sequence model will typically be written in script but can call an encoder module generated using tracing.

Example:

import torch

def foo(x, y):
    return 2 * x + y
traced_foo = torch.jit.trace(foo, (torch.rand(3), torch.rand(3)))

@torch.jit.script
def bar(x):
    return traced_foo(x, x)

Traced functions can call script functions. This is useful when a small part of a model requires some control-flow even though most of the model is just a feed-forward network. Control-flow inside of a script function called by a traced function is preserved correctly:

Example:

import torch

@torch.jit.script
def foo(x, y):
    if x.max() > y.max():
        r = x
    else:
        r = y
    return r


def bar(x, y, z):
    return foo(x, y) + z

traced_bar = torch.jit.trace(bar, (torch.rand(3), torch.rand(3), torch.rand(3))

This composition also works for modules as well, where it can be used to generate a submodule using tracing that can be called from the methods of a script module:

Example:

import torch
import torchvision

class MyScriptModule(torch.jit.ScriptModule):
    def __init__(self):
        super(MyScriptModule, self).__init__()
        self.means = torch.nn.Parameter(torch.tensor([103.939, 116.779, 123.68])
                                        .resize_(1, 3, 1, 1))
        self.resnet = torch.jit.trace(torchvision.models.resnet18(),
                                      torch.rand(1, 3, 224, 224))

    @torch.jit.script_method
    def forward(self, input):
        return self.resnet(input - self.means)

Torch Script Language Reference

Torch Script is a subset of Python that can either be written directly (using the @script annotations) or generated automatically from Python code via tracing. When using tracing, code is automatically converted into this subset of Python by recording only the actual operators on tensors and simply executing and discarding the other surrounding Python code.

When writing Torch Script directly using @script annotations, the programmer must only use the subset of Python supported in Torch Script. This section documents what is supported in Torch Script as if it were a language reference for a stand alone language. Any features of Python not mentioned in this reference are not part of Torch Script.

As a subset of Python any valid Torch Script function is also a valid Python function. This makes it possible to remove the @script annotations and debug the function using standard Python tools like pdb. The reverse is not true: there are many valid python programs that are not valid Torch Script programs. Instead, Torch Script focuses specifically on the features of Python that are needed to represent neural network models in Torch.

PYTORCH_JIT=1

Setting the environment variable PYTORCH_JIT=0 will disable all script and tracing annotations. If there is hard-to-debug error in one of your ScriptModules, you can use this flag to force everything to run using native Python. This allows the use of tools like pdb to debug code.

Types

The largest difference between Torch Script and the full Python language is that Torch Script only support a small set of types that are needed to express neural net models. In particular Torch Script supports:

Tensor
A PyTorch tensor of any dtype, dimension, or backend.
Tuple[T0, T1, ...]
A tuple containing subtypes T0, T1, etc. (e.g. Tuple[Tensor, Tensor])
int
A scalar integer
float
A scalar floating point number
List[T]
A list of which all members are type T

Unlike Python, each variable in Torch Script function must have a single static type. This makes it easier to optimize Torch Script functions.

Example:

@torch.jit.script
def an_error(x):
    if x:
        r = torch.rand(1)
    else:
        r = 4
    return r # Type mismatch: r is set to type Tensor in the true branch
             # and type int in the false branch

By default, all parameters to a Torch Script function are assumed to be Tensor because this is the most common type used in modules. To specify that an argument to a Torch Script function is another type, it is possible to use MyPy-style type annotations using the types listed above:

Example:

@torch.jit.script
def foo(x, tup):
    # type: (int, Tuple[Tensor, Tensor]) -> Tensor
    t0, t1 = tup
    return t0 + t1 + x

print(foo(3, (torch.rand(3), torch.rand(3))))

Note

It is also possible to annotate types with Python 3 type annotations. In our examples, we use comment-based annotations to ensure Python 2 compatibility as well.

Expressions

The following Python Expressions are supported

Literals
True, False, None, 'string literals', "string literals", number literals 3 (interpreted as int) 3.4 (interpreter as a float)
Variables

a

Note

See Variable Resolution for how variables are resolved.

Tuple Construction
(3, 4), (3,)
List Construction

[3, 4], [], [torch.rand(3), torch.rand(4)]

Note

an empty list is assumed have type List[Tensor]. The types of other list literals are derived from the type of the members.

Arithmetic Operators
a + b a - b a * b a / b a ^ b a @ b
Comparison Operators
a == b a != b a < b a > b a <= b a >= b
Logical Operators
a and b a or b not b
Subscripts

t[0] t[-1] t[0:2] t[1:] t[:1] t[:] t[0, 1] t[0, 1:2] t[0, :1] t[-1, 1:, 0] t[1:, -1, 0] t[i:j, i]

Note

Torch Script currently does not support mutating tensors in place, so any tensor indexing can only appear on the right-hand size of an expression.

Function calls

Calls to built-in functions: torch.rand(3, dtype=torch.int)

Calls to other script functions:

import torch

@torch.jit.script
def foo(x):
  return x + 1

@torch.jit.script
def bar(x):
  return foo(x)
Method calls

Calls to methods of builtin types like tensor: x.mm(y)

When defining a Script method inside of a ScriptModule, the @script_method annotation is used. Inside of these methods it is possible to call other methods of this class or access methods on the submodules.

Calling a submodule directly (e.g. self.resnet(input)) is equivalent to calling its forward method (e.g. self.resnet.forward(input))

import torch

class MyScriptModule(torch.jit.ScriptModule):
    def __init__(self):
        super(MyScriptModule, self).__init__()
        self.means = torch.nn.Parameter(torch.tensor([103.939, 116.779, 123.68])
                                        .resize_(1, 3, 1, 1))
        self.resnet = torch.jit.trace(torchvision.models.resnet18(),
                                      torch.rand(1, 3, 224, 224))

    @torch.jit.script_method
    def helper(self, input):
      return self.resnet(input - self.means)

    @torch.jit.script_method
    def forward(self, input):
        return self.helper(input)
If expressions
x if x > y else y
Casts
float(ten), int(3.5), bool(ten)
Accessing Module Parameters
self.my_parameter self.my_submodule.my_parameter

Statements

Torch Script supports the following types of statements:

Simple Assignments

a = b
a += b # short-hand for a = a + b, does not operate in-place on a
a -= b

Pattern Matching Assignments

a, b = tuple_or_list
a, b, *c = a_tuple

Print Statements

print("the result of an add:", a + b)

If Statements

if a < 4:
    r = -a
elif a < 3:
    r = a + a
else:
    r = 3 * a

While Loops

a = 0
while a < 4:
    print(a)
    a += 1

For loops with range

x = 0
for i in range(10):
    x *= i

Note

Script currently does not support iterating over generic iterable objects like lists or tensors. Script currently does not support start or increment parameters to range. These will be added in a future version.

For loops over tuples:

tup = (3, torch.rand(4))
for x in tup:
    print(x)

Note

for loops over tuples will unroll the loop, generating a body for each member of the tuple. The body must type-check correctly for each member.

For loops over constant torch.nn.ModuleList

class SubModule(torch.jit.ScriptModule):
    def __init__(self):
        super(Sub, self).__init__()
        self.weight = nn.Parameter(torch.randn(2))

    @torch.jit.script_method
    def forward(self, input):
        return self.weight + input

class MyModule(torch.jit.ScriptModule):
    __constants__ = ['mods']

    def __init__(self):
        super(MyModule, self).__init__()
        self.mods = torch.nn.ModuleList([SubModule() for i in range(10)])

    @torch.jit.script_method
    def forward(self, v):
        for module in self.mods:
            v = m(v)
        return v

Note

To use a module list inside a @script_method it must be marked constant by adding the name of the attribute to the __constants__ list for the type. For loops over a ModuleList will unroll the body of the loop at compile time, with each member of the constant module list.

Return

return a, b

Note

there must be a return statement as the last member of the function and return statements cannot appear anywhere else in the function. This restriction will be removed in the future.

Variable Resolution

Torch Script supports a subset of Python’s variable resolution (i.e. scoping) rules. Local variables behave the same as in Python, except for the restriction that a variable must have the same type along all paths through a function. If a variable has a different type on different sides of an if statement, it is an error to use it after the end of the if statement.

Similarly, a variable is not allowed to be used if it is only defined along some paths through the function.

Example:

@torch.jit.script
def foo(x):
    if x < 0:
        y = 4
    print(y) # Error: undefined value y

Non-local variables are resolved to Python values at compile time when the function is defined. These values are then converted into Torch Script values using the rules described in Use of Python Values.

Use of Python Values

To make writing Torch Script more convenient, we allow script code to refer to Python values in the surrounding scope. For instance, any time there is a reference to torch, the Torch Script compiler is actually resolving it to the torch Python module when the function is declared. These Python values are not a first class part of Torch Script. Instead they are desugared at compile-time into the primitive types that Torch Script supports. This section describes the rules that are used when accessing Python values in Torch Script. They depend on the dynamic type of the python valued referenced.

Functions

Torch Script can call python functions. This functionality is very useful when incrementally converting a model into script. The model can be moved function-by-function to script, leaving calls to Python functions in place. This way you can incrementally check the correctness of the model as you go.

Example:

def foo(x):
  print("I am called with {}".format(x))
  import pdb; pdb.set_trace()
  return x

@torch.jit.script
def bar(x)
  return foo(x + 1)

Note

Attempting to call save on a ScriptModule that contains calls to Python functions will fail. The intention is that this pathway is used for debugging and the calls removed or turned into script functions before saving.

Attribute Lookup On Python Modules
Torch Script can lookup attributes on modules. Builtin functions like torch.add are accessed this way. This allows Torch Script to call functions defined in other modules.
Python-defined Constants

Torch Script also provides a way to use constants that are defined in Python. These can be used to hard-code hyper-parameters into the function, or to define universal constants. There are two ways of specifying that a Python value should be treated as a constant.

  1. Values looked up as attributes of a module are assumed to be constant. Example: math.pi

  2. Attributes of a ScriptModule can be marked constant by listing them as a member of the __constants__ property of the class:

    Example:

    class Foo(torch.jit.ScriptModule):
        __constants__ = ['a']
    
        def __init__(self):
            super(Foo, self).__init__(False)
            self.a = 1 + 4
    
       @torch.jit.ScriptModule
       def forward(self, input):
           return self.a + input
    

Supported constant Python Values are

  • int
  • bool
  • torch.device
  • torch.layout
  • torch.dtype
  • tuples containing supported types
  • torch.nn.ModuleList which can be used in a TorchScript for loop

Debugging

Disable JIT for Debugging

If you want to disable all JIT modes (tracing and scripting) so you can debug your program in raw Python, you can use the PYTORCH_JIT environment variable. PYTORCH_JIT can be used to globally disable the JIT by setting its value to 0. Given an example script:

@torch.jit.script
def scripted_fn(x : torch.Tensor):
    for i in range(12):
        x = x + x
    return x


def fn(x):
    x = torch.neg(x)
    import pdb; pdb.set_trace()
    return scripted_fn(x)

traced_fn = torch.jit.trace(fn, (torch.rand(4, 5),))

traced_fn(torch.rand(3, 4))

Debugging this script with PDB works except for when we invoke the @script function. We can globally disable JIT, so that we can call the @script function as a normal python function and not compile it. If the above script is called disable_jit_example.py, we can invoke it like so:

$ PYTORCH_JIT=0 python disable_jit_example.py

and we will be able to step into the @script function as a normal Python function.

Interpreting Graphs

TorchScript uses a static single assignment (SSA) intermediate representation (IR) to represent computation. The instructions in this format consist of ATen (the C++ backend of PyTorch) operators and other primitive operators, including control flow operators for loops and conditionals. As an example:

@torch.jit.script
def foo(len):
  # type: (int) -> torch.Tensor
  rv = torch.zeros(3, 4)
  for i in range(len):
    if i < 10:
        rv = rv - 1.0
    else:
        rv = rv + 1.0
  return rv

print(foo.graph)

A ScriptModule with a single forward method will have an attribute graph, which you can use to inspect the IR representing the computation. If the ScriptModule has more than one method, you will need to access .graph on the method itself and not the module. We can inspect the graph of a method named bar on a ScriptModule by accessing .bar.graph.

The example script above produces the graph:

graph(%len : int) {
  %13 : float = prim::Constant[value=1]()
  %10 : int = prim::Constant[value=10]()
  %2 : int = prim::Constant[value=4]()
  %1 : int = prim::Constant[value=3]()
  %3 : int[] = prim::ListConstruct(%1, %2)
  %4 : int = prim::Constant[value=6]()
  %5 : int = prim::Constant[value=0]()
  %6 : int[] = prim::Constant[value=[0, -1]]()
  %rv.1 : Dynamic = aten::zeros(%3, %4, %5, %6)
  %8 : int = prim::Constant[value=1]()
  %rv : Dynamic = prim::Loop(%len, %8, %rv.1)
    block0(%i : int, %12 : Dynamic) {
      %11 : int = aten::lt(%i, %10)
      %rv.4 : Dynamic = prim::If(%11)
        block0() {
          %14 : int = prim::Constant[value=1]()
          %rv.2 : Dynamic = aten::sub(%12, %13, %14)
          -> (%rv.2)
        }
        block1() {
          %16 : int = prim::Constant[value=1]()
          %rv.3 : Dynamic = aten::add(%12, %13, %16)
          -> (%rv.3)
        }
      %19 : int = prim::Constant[value=1]()
      -> (%19, %rv.4)
    }
  return (%rv);
}

Take the instruction %rv.1 : Dynamic = aten::zeros(%3, %4, %5, %6) for example. %rv.1 : Dynamic means we assign the output to a (unique) value named rv.1, and that value is of Dynamic type, i.e. we do not know its concrete shape. aten::zeros is the operator (equivalent to torch.zeros) and the input list (%3, %4, %5, %6) specifies which values in scope should be passed as inputs. The schema for built-in functions like aten::zeros can be found at Builtin Functions.

Notice that operators can also have associated blocks, namely the prim::Loop and prim::If operators. In the graph print-out, these operators are formatted to reflect their equivalent source code forms to facilitate easy debugging.

Graphs can be inspected as shown to confirm that the computation described by a ScriptModule is correct, in both automated and manual fashion, as described below.

Tracing Edge Cases

There are some edge cases that exist where the trace of a given Python function/module will not be representative of the underlying code. These cases can include:

  • Tracing of control flow that is dependent on inputs (e.g. tensor shapes)
  • Tracing of in-place operations of tensor views (e.g. indexing on the left-hand side of an assignment)

Note that these cases may in fact be traceable in the future.

Automatic Trace Checking

One way to automatically catch many errors in traces is by using check_inputs on the torch.jit.trace() API. check_inputs takes a list of tuples of inputs that will be used to re-trace the computation and verify the results. For example:

def loop_in_traced_fn(x):
    result = x[0]
    for i in range(x.size(0)):
        result = result * x[i]
    return result

inputs = (torch.rand(3, 4, 5),)
check_inputs = [(torch.rand(4, 5, 6),), (torch.rand(2, 3, 4),)]

traced = torch.jit.trace(loop_in_traced_fn, inputs, check_inputs=check_inputs)

Gives us the following diagnostic information:

ERROR: Graphs differed across invocations!
Graph diff:
    graph(%0 : Dynamic) {
          %1 : int = prim::Constant[value=0]()
          %2 : int = prim::Constant[value=0]()
          %3 : Dynamic = aten::select(%0, %1, %2)
          %4 : int = prim::Constant[value=0]()
          %5 : int = prim::Constant[value=0]()
          %6 : Dynamic = aten::select(%0, %4, %5)
          %7 : Dynamic = aten::mul(%3, %6)
          %8 : int = prim::Constant[value=0]()
          %9 : int = prim::Constant[value=1]()
          %10 : Dynamic = aten::select(%0, %8, %9)
          %11 : Dynamic = aten::mul(%7, %10)
          %12 : int = prim::Constant[value=0]()
          %13 : int = prim::Constant[value=2]()
          %14 : Dynamic = aten::select(%0, %12, %13)
          %15 : Dynamic = aten::mul(%11, %14)
      +   %16 : int = prim::Constant[value=0]()
      +   %17 : int = prim::Constant[value=3]()
      +   %18 : Dynamic = aten::select(%0, %16, %17)
      +   %19 : Dynamic = aten::mul(%15, %18)
      -   return (%15);
      ?             ^
      +   return (%19);
      ?             ^
    }

This message indicates to us that the computation differed between when we first traced it and when we traced it with the check_inputs. Indeed, the loop within the body of loop_in_traced_fn depends on the shape of the input x, and thus when we try another x with a different shape, the trace differs.

In this case, data-dependent control flow like this can be captured using script instead:

def fn(x):
    result = x[0]
    for i in range(x.size(0)):
        result = result * x[i]
    return result

inputs = (torch.rand(3, 4, 5),)
check_inputs = [(torch.rand(4, 5, 6),), (torch.rand(2, 3, 4),)]

scripted_fn = torch.jit.script(fn)
print(scripted_fn.graph)

for input_tuple in [inputs] + check_inputs:
    torch.testing.assert_allclose(fn(*input_tuple), scripted_fn(*input_tuple))

Which produces:

graph(%x : Dynamic) {
  %1 : int = prim::Constant[value=0]()
  %2 : int = prim::Constant[value=0]()
  %result.1 : Dynamic = aten::select(%x, %2, %1)
  %4 : int = aten::size(%x, %1)
  %5 : int = prim::Constant[value=1]()
  %result : Dynamic = prim::Loop(%4, %5, %result.1)
    block0(%i : int, %7 : Dynamic) {
      %9 : int = prim::Constant[value=0]()
      %10 : Dynamic = aten::select(%x, %9, %i)
      %result.2 : Dynamic = aten::mul(%7, %10)
      %12 : int = prim::Constant[value=1]()
      -> (%12, %result.2)
    }
  return (%result);
}
Tracer Warnings

The tracer produces warnings for several problematic patterns in traced computation. As an example, take a trace of a function that contains an in-place assignment on a slice (a view) of a Tensor:

def fill_row_zero(x):
    x[0] = torch.rand(*x.shape[1:2])
    return x

traced = torch.jit.trace(fill_row_zero, (torch.rand(3, 4),))
print(traced.graph)

Produces several warnings and a graph which simply returns the input:

fill_row_zero.py:4: TracerWarning: There are 2 live references to the data region being modified when tracing in-place operator copy_ (possibly due to an assignment). This might cause the trace to be incorrect, because all other views that also reference this data will not not reflect this change in the trace! On the other hand, if all other views use the same memory chunk, but are disjoint (e.g. are outputs of torch.split), this might still be safe.
  x[0] = torch.rand(*x.shape[1:2])
fill_row_zero.py:6: TracerWarning: Output nr 1. of the traced function does not match the corresponding output of the Python function. Detailed error:
Not within tolerance rtol=1e-05 atol=1e-05 at input[0, 1] (0.09115803241729736 vs. 0.6782537698745728) and 3 other locations (33.00%)
  traced = torch.jit.trace(fill_row_zero, (torch.rand(3, 4),))
graph(%0 : Float(3, 4)) {
  return (%0);
}

We can fix this by modifying the code to not use the in-place update, but rather build up the result tensor out-of-place with torch.cat:

def fill_row_zero(x):
    x = torch.cat((torch.rand(1, *x.shape[1:2]), x[1:2]), dim=0)
    return x

traced = torch.jit.trace(fill_row_zero, (torch.rand(3, 4),))
print(traced.graph)

Builtin Functions

Torch Script supports a subset of the builtin tensor and neural network functions that PyTorch provides. Most methods on Tensor as well as functions in the torch namespace are available. Many functions in torch.nn.functional are also availiable.

We currently do not provide any builtin ScriptModules e.g. a Linear or Conv module. This functionality is something that will be developed in the future. For now we suggest using torch.jit.trace to transform standard torch.nn modules into ScriptModules on construction.

Supported Functions

torch.Size(sizes : List[int]) -> List[int]

torch.__and__(self : Tensor,
              other : Tensor) -> Tensor

torch.__and__(self : Tensor,
              other : Scalar) -> Tensor

torch.__and__(a : bool,
              b : bool) -> bool

torch.__lshift__(self : Tensor,
                 other : Tensor) -> Tensor

torch.__lshift__(self : Tensor,
                 other : Scalar) -> Tensor

torch.__or__(self : Tensor,
             other : Tensor) -> Tensor

torch.__or__(self : Tensor,
             other : Scalar) -> Tensor

torch.__or__(a : bool,
             b : bool) -> bool

torch.__rshift__(self : Tensor,
                 other : Tensor) -> Tensor

torch.__rshift__(self : Tensor,
                 other : Scalar) -> Tensor

torch.__xor__(self : Tensor,
              other : Tensor) -> Tensor

torch.__xor__(self : Tensor,
              other : Scalar) -> Tensor

torch.abs(self : Tensor) -> Tensor

torch.abs(self : Tensor,
          out : Tensor) -> Tensor

torch.abs_(self : Tensor) -> Tensor

torch.acos(self : Tensor,
           out : Tensor) -> Tensor

torch.acos(self : Tensor) -> Tensor

torch.acos_(self : Tensor) -> Tensor

torch.adaptive_avg_pool1d(self : Tensor,
                          output_size : List[int]) -> Tensor

torch.adaptive_max_pool1d(self : Tensor,
                          output_size : List[int]) -> Tuple[Tensor, Tensor]

torch.add(self : Tensor,
          other : Tensor,
          alpha : Scalar=1) -> Tensor

torch.add(self : Tensor,
          other : Scalar,
          alpha : Scalar=1) -> Tensor

torch.add(self : Tensor,
          other : Tensor,
          alpha : Scalar=1,
          out : Tensor) -> Tensor

torch.add(a : string,
          b : string) -> string

torch.add(a : List[int],
          b : List[int]) -> List[int]

torch.add(a : List[float],
          b : List[float]) -> List[float]

torch.add(a : List[Tensor],
          b : List[Tensor]) -> List[Tensor]

torch.add(a : List[t],
          b : List[t]) -> List[t]

torch.add(a : int,
          b : int) -> int

torch.add(a : float,
          b : float) -> float

torch.add(a : int,
          b : float) -> float

torch.add(a : float,
          b : int) -> float

torch.addbmm(self : Tensor,
             batch1 : Tensor,
             batch2 : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1) -> Tensor

torch.addbmm(self : Tensor,
             batch1 : Tensor,
             batch2 : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1,
             out : Tensor) -> Tensor

torch.addcdiv(self : Tensor,
              tensor1 : Tensor,
              tensor2 : Tensor,
              value : Scalar=1,
              out : Tensor) -> Tensor

torch.addcdiv(self : Tensor,
              tensor1 : Tensor,
              tensor2 : Tensor,
              value : Scalar=1) -> Tensor

torch.addcmul(self : Tensor,
              tensor1 : Tensor,
              tensor2 : Tensor,
              value : Scalar=1) -> Tensor

torch.addcmul(self : Tensor,
              tensor1 : Tensor,
              tensor2 : Tensor,
              value : Scalar=1,
              out : Tensor) -> Tensor

torch.addmm(self : Tensor,
            mat1 : Tensor,
            mat2 : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1,
            out : Tensor) -> Tensor

torch.addmm(self : Tensor,
            mat1 : Tensor,
            mat2 : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1) -> Tensor

torch.addmv(self : Tensor,
            mat : Tensor,
            vec : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1,
            out : Tensor) -> Tensor

torch.addmv(self : Tensor,
            mat : Tensor,
            vec : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1) -> Tensor

torch.addmv_(self : Tensor,
             mat : Tensor,
             vec : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1) -> Tensor

torch.addr(self : Tensor,
           vec1 : Tensor,
           vec2 : Tensor,
           beta : Scalar=1,
           alpha : Scalar=1) -> Tensor

torch.addr(self : Tensor,
           vec1 : Tensor,
           vec2 : Tensor,
           beta : Scalar=1,
           alpha : Scalar=1,
           out : Tensor) -> Tensor

torch.all(self : Tensor) -> Tensor

torch.all(self : Tensor,
          dim : int,
          keepdim : bool=False) -> Tensor

torch.all(self : Tensor,
          dim : int,
          keepdim : bool=False,
          out : Tensor) -> Tensor

torch.allclose(self : Tensor,
               other : Tensor,
               rtol : float=1e-05,
               atol : float=1e-08,
               equal_nan : bool=False) -> bool

torch.alpha_dropout(input : Tensor,
                    p : float,
                    train : bool) -> Tensor

torch.alpha_dropout_(self : Tensor,
                     p : float,
                     train : bool) -> Tensor

torch.any(self : Tensor) -> Tensor

torch.any(self : Tensor,
          dim : int,
          keepdim : bool=False) -> Tensor

torch.any(self : Tensor,
          dim : int,
          keepdim : bool=False,
          out : Tensor) -> Tensor

torch.arange(end : Scalar,
             dtype : int=6,
             layout : int=0,
             device : List[int]=[0, -1]) -> Tensor

torch.arange(start : Scalar,
             end : Scalar,
             dtype : int=6,
             layout : int=0,
             device : List[int]=[0, -1]) -> Tensor

torch.arange(start : Scalar,
             end : Scalar,
             step : Scalar,
             dtype : int=6,
             layout : int=0,
             device : List[int]=[0, -1]) -> Tensor

torch.arange(end : Scalar,
             out : Tensor) -> Tensor

torch.arange(start : Scalar,
             end : Scalar,
             out : Tensor) -> Tensor

torch.arange(start : Scalar,
             end : Scalar,
             step : Scalar,
             out : Tensor) -> Tensor

torch.argmax(self : Tensor) -> Tensor

torch.argmax(self : Tensor,
             dim : int,
             keepdim : bool=False) -> Tensor

torch.argmin(self : Tensor) -> Tensor

torch.argmin(self : Tensor,
             dim : int,
             keepdim : bool=False) -> Tensor

torch.as_strided(self : Tensor,
                 size : List[int],
                 stride : List[int]) -> Tensor

torch.as_strided(self : Tensor,
                 size : List[int],
                 stride : List[int],
                 storage_offset : int) -> Tensor

torch.as_strided_(self : Tensor,
                  size : List[int],
                  stride : List[int]) -> Tensor

torch.as_strided_(self : Tensor,
                  size : List[int],
                  stride : List[int],
                  storage_offset : int) -> Tensor

torch.asin(self : Tensor) -> Tensor

torch.asin(self : Tensor,
           out : Tensor) -> Tensor

torch.asin_(self : Tensor) -> Tensor

torch.atan(self : Tensor) -> Tensor

torch.atan(self : Tensor,
           out : Tensor) -> Tensor

torch.atan2(self : Tensor,
            other : Tensor,
            out : Tensor) -> Tensor

torch.atan2(self : Tensor,
            other : Tensor) -> Tensor

torch.atan_(self : Tensor) -> Tensor

torch.avg_pool1d(self : Tensor,
                 kernel_size : List[int],
                 stride : List[int]=[],
                 padding : List[int]=[0],
                 ceil_mode : bool=False,
                 count_include_pad : bool=True) -> Tensor

torch.baddbmm(self : Tensor,
              batch1 : Tensor,
              batch2 : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1) -> Tensor

torch.baddbmm(self : Tensor,
              batch1 : Tensor,
              batch2 : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1,
              out : Tensor) -> Tensor

torch.bartlett_window(window_length : int,
                      dtype : int=6,
                      layout : int=0,
                      device : List[int]=[0, -1]) -> Tensor

torch.bartlett_window(window_length : int,
                      periodic : bool,
                      dtype : int=6,
                      layout : int=0,
                      device : List[int]=[0, -1]) -> Tensor

torch.batch_norm(input : Tensor,
                 weight : Optional[Tensor],
                 bias : Optional[Tensor],
                 running_mean : Optional[Tensor],
                 running_var : Optional[Tensor],
                 training : bool,
                 momentum : float,
                 eps : float,
                 cudnn_enabled : bool) -> Tensor

torch.bernoulli(self : Tensor,
                generator : Generator) -> Tensor

torch.bernoulli(self : Tensor,
                p : float,
                generator : Generator) -> Tensor

torch.bernoulli(self : Tensor,
                generator : Generator,
                out : Tensor) -> Tensor

torch.bilinear(input1 : Tensor,
               input2 : Tensor,
               weight : Tensor,
               bias : Optional[Tensor]) -> Tensor

torch.binary_cross_entropy_with_logits(self : Tensor,
                                       target : Tensor,
                                       weight : Optional[Tensor],
                                       pos_weight : Optional[Tensor],
                                       reduction : int) -> Tensor

torch.bincount(self : Tensor,
               weights : Optional[Tensor],
               minlength : int=0) -> Tensor

torch.blackman_window(window_length : int,
                      dtype : int=6,
                      layout : int=0,
                      device : List[int]=[0, -1]) -> Tensor

torch.blackman_window(window_length : int,
                      periodic : bool,
                      dtype : int=6,
                      layout : int=0,
                      device : List[int]=[0, -1]) -> Tensor

torch.bmm(self : Tensor,
          mat2 : Tensor) -> Tensor

torch.bmm(self : Tensor,
          mat2 : Tensor,
          out : Tensor) -> Tensor

torch.broadcast_tensors(tensors : List[Tensor]) -> List[Tensor]

torch.btrifact(self : Tensor,
               pivot : bool=True) -> Tuple[Tensor, Tensor]

torch.btrifact_with_info(self : Tensor,
                         pivot : bool=True) -> Tuple[Tensor, Tensor, Tensor]

torch.btrisolve(self : Tensor,
                LU_data : Tensor,
                LU_pivots : Tensor,
                out : Tensor) -> Tensor

torch.btrisolve(self : Tensor,
                LU_data : Tensor,
                LU_pivots : Tensor) -> Tensor

torch.cat(tensors : List[Tensor],
          dim : int=0) -> Tensor

torch.cat(tensors : List[Tensor],
          dim : int=0,
          out : Tensor) -> Tensor

torch.ceil(self : Tensor,
           out : Tensor) -> Tensor

torch.ceil(self : Tensor) -> Tensor

torch.ceil_(self : Tensor) -> Tensor

torch.celu(self : Tensor,
           alpha : Scalar=1.0) -> Tensor

torch.celu_(self : Tensor,
            alpha : Scalar=1.0) -> Tensor

torch.chain_matmul(matrices : List[Tensor]) -> Tensor

torch.cholesky(self : Tensor,
               upper : bool=False,
               out : Tensor) -> Tensor

torch.cholesky(self : Tensor,
               upper : bool=False) -> Tensor

torch.chunk(self : Tensor,
            chunks : int,
            dim : int=0) -> List[Tensor]

torch.clamp(self : Tensor,
            min : Optional[Scalar],
            max : Optional[Scalar]) -> Tensor

torch.clamp(self : Tensor,
            min : Optional[Scalar],
            max : Optional[Scalar],
            out : Tensor) -> Tensor

torch.clamp_(self : Tensor,
             min : Optional[Scalar],
             max : Optional[Scalar]) -> Tensor

torch.clamp_max(self : Tensor,
                max : Scalar) -> Tensor

torch.clamp_max(self : Tensor,
                max : Scalar,
                out : Tensor) -> Tensor

torch.clamp_max_(self : Tensor,
                 max : Scalar) -> Tensor

torch.clamp_min(self : Tensor,
                min : Scalar,
                out : Tensor) -> Tensor

torch.clamp_min(self : Tensor,
                min : Scalar) -> Tensor

torch.clamp_min_(self : Tensor,
                 min : Scalar) -> Tensor

torch.clone(self : Tensor) -> Tensor

torch.constant_pad_nd(self : Tensor,
                      pad : List[int],
                      value : Scalar=0) -> Tensor

torch.conv1d(input : Tensor,
             weight : Tensor,
             bias : Tensor,
             stride : List[int]=[1],
             padding : List[int]=[0],
             dilation : List[int]=[1],
             groups : int=1) -> Tensor

torch.conv2d(input : Tensor,
             weight : Tensor,
             bias : Tensor,
             stride : List[int]=[1, 1],
             padding : List[int]=[0, 0],
             dilation : List[int]=[1, 1],
             groups : int=1) -> Tensor

torch.conv3d(input : Tensor,
             weight : Tensor,
             bias : Tensor,
             stride : List[int]=[1, 1, 1],
             padding : List[int]=[0, 0, 0],
             dilation : List[int]=[1, 1, 1],
             groups : int=1) -> Tensor

torch.conv_tbc(self : Tensor,
               weight : Tensor,
               bias : Tensor,
               pad : int=0) -> Tensor

torch.conv_transpose1d(input : Tensor,
                       weight : Tensor,
                       bias : Tensor,
                       stride : List[int]=[1],
                       padding : List[int]=[0],
                       output_padding : List[int]=[0],
                       groups : int=1,
                       dilation : List[int]=[1]) -> Tensor

torch.conv_transpose2d(input : Tensor,
                       weight : Tensor,
                       bias : Tensor,
                       stride : List[int]=[1, 1],
                       padding : List[int]=[0, 0],
                       output_padding : List[int]=[0, 0],
                       groups : int=1,
                       dilation : List[int]=[1, 1]) -> Tensor

torch.conv_transpose3d(input : Tensor,
                       weight : Tensor,
                       bias : Tensor,
                       stride : List[int]=[1, 1, 1],
                       padding : List[int]=[0, 0, 0],
                       output_padding : List[int]=[0, 0, 0],
                       groups : int=1,
                       dilation : List[int]=[1, 1, 1]) -> Tensor

torch.convolution(input : Tensor,
                  weight : Tensor,
                  bias : Optional[Tensor],
                  stride : List[int],
                  padding : List[int],
                  dilation : List[int],
                  transposed : bool,
                  output_padding : List[int],
                  groups : int) -> Tensor

torch.cos(self : Tensor) -> Tensor

torch.cos(self : Tensor,
          out : Tensor) -> Tensor

torch.cos_(self : Tensor) -> Tensor

torch.cosh(self : Tensor) -> Tensor

torch.cosh(self : Tensor,
           out : Tensor) -> Tensor

torch.cosh_(self : Tensor) -> Tensor

torch.cosine_embedding_loss(input1 : Tensor,
                            input2 : Tensor,
                            target : Tensor,
                            margin : float=0.0,
                            reduction : int=1) -> Tensor

torch.cross(self : Tensor,
            other : Tensor,
            dim : int=-1,
            out : Tensor) -> Tensor

torch.cross(self : Tensor,
            other : Tensor,
            dim : int=-1) -> Tensor

torch.ctc_loss(log_probs : Tensor,
               targets : Tensor,
               input_lengths : Tensor,
               target_lengths : Tensor,
               blank : int=0,
               reduction : int=1) -> Tensor

torch.ctc_loss(log_probs : Tensor,
               targets : Tensor,
               input_lengths : List[int],
               target_lengths : List[int],
               blank : int=0,
               reduction : int=1) -> Tensor

torch.cudnn_affine_grid_generator(theta : Tensor,
                                  N : int,
                                  C : int,
                                  H : int,
                                  W : int) -> Tensor

torch.cudnn_batch_norm(input : Tensor,
                       weight : Tensor,
                       bias : Optional[Tensor],
                       running_mean : Optional[Tensor],
                       running_var : Optional[Tensor],
                       training : bool,
                       exponential_average_factor : float,
                       epsilon : float) -> Tuple[Tensor, Tensor, Tensor]

torch.cudnn_convolution(self : Tensor,
                        weight : Tensor,
                        bias : Optional[Tensor],
                        padding : List[int],
                        stride : List[int],
                        dilation : List[int],
                        groups : int,
                        benchmark : bool,
                        deterministic : bool) -> Tensor

torch.cudnn_convolution_transpose(self : Tensor,
                                  weight : Tensor,
                                  bias : Optional[Tensor],
                                  padding : List[int],
                                  output_padding : List[int],
                                  stride : List[int],
                                  dilation : List[int],
                                  groups : int,
                                  benchmark : bool,
                                  deterministic : bool) -> Tensor

torch.cudnn_grid_sampler(self : Tensor,
                         grid : Tensor) -> Tensor

torch.cudnn_is_acceptable(self : Tensor) -> bool

torch.cumprod(self : Tensor,
              dim : int) -> Tensor

torch.cumprod(self : Tensor,
              dim : int,
              dtype : int) -> Tensor

torch.cumprod(self : Tensor,
              dim : int,
              out : Tensor) -> Tensor

torch.cumprod(self : Tensor,
              dim : int,
              dtype : int,
              out : Tensor) -> Tensor

torch.cumsum(self : Tensor,
             dim : int) -> Tensor

torch.cumsum(self : Tensor,
             dim : int,
             dtype : int) -> Tensor

torch.cumsum(self : Tensor,
             dim : int,
             out : Tensor) -> Tensor

torch.cumsum(self : Tensor,
             dim : int,
             dtype : int,
             out : Tensor) -> Tensor

torch.det(self : Tensor) -> Tensor

torch.detach(self : Tensor) -> Tensor

torch.detach_(self : Tensor) -> Tensor

torch.diag(self : Tensor,
           diagonal : int=0) -> Tensor

torch.diag(self : Tensor,
           diagonal : int=0,
           out : Tensor) -> Tensor

torch.diag_embed(self : Tensor,
                 offset : int=0,
                 dim1 : int=-2,
                 dim2 : int=-1) -> Tensor

torch.diagflat(self : Tensor,
               offset : int=0) -> Tensor

torch.diagonal(self : Tensor,
               offset : int=0,
               dim1 : int=0,
               dim2 : int=1) -> Tensor

torch.digamma(self : Tensor) -> Tensor

torch.digamma(self : Tensor,
              out : Tensor) -> Tensor

torch.dist(self : Tensor,
           other : Tensor,
           p : Scalar=2) -> Tensor

torch.div(self : Tensor,
          other : Tensor,
          out : Tensor) -> Tensor

torch.div(self : Tensor,
          other : Tensor) -> Tensor

torch.div(self : Tensor,
          other : Scalar) -> Tensor

torch.div(a : int,
          b : int) -> float

torch.div(a : float,
          b : float) -> float

torch.dot(self : Tensor,
          tensor : Tensor) -> Tensor

torch.dot(self : Tensor,
          tensor : Tensor,
          out : Tensor) -> Tensor

torch.dropout(input : Tensor,
              p : float,
              train : bool) -> Tensor

torch.dropout_(self : Tensor,
               p : float,
               train : bool) -> Tensor

torch.eig(self : Tensor,
          eigenvectors : bool=False) -> Tuple[Tensor, Tensor]

torch.einsum(equation : string,
             tensors : List[Tensor]) -> Tensor

torch.embedding(weight : Tensor,
                indices : Tensor,
                padding_idx : int=-1,
                scale_grad_by_freq : bool=False,
                sparse : bool=False) -> Tensor

torch.embedding_bag(weight : Tensor,
                    indices : Tensor,
                    offsets : Tensor,
                    scale_grad_by_freq : bool=False,
                    mode : int=0,
                    sparse : bool=False) -> Tuple[Tensor, Tensor, Tensor, Tensor]

torch.embedding_renorm_(self : Tensor,
                        indices : Tensor,
                        max_norm : float,
                        norm_type : float) -> Tensor

torch.empty(size : List[int],
            dtype : int=6,
            layout : int=0,
            device : List[int]=[0, -1]) -> Tensor

torch.empty(size : List[int],
            out : Tensor) -> Tensor

torch.empty_like(self : Tensor) -> Tensor

torch.empty_like(self : Tensor,
                 dtype : int=6,
                 layout : int=0,
                 device : List[int]=[0, -1]) -> Tensor

torch.empty_strided(size : List[int],
                    stride : List[int],
                    dtype : int=6,
                    layout : int=0,
                    device : List[int]=[0, -1]) -> Tensor

torch.eq(self : Tensor,
         other : Tensor) -> Tensor

torch.eq(self : Tensor,
         other : Scalar) -> Tensor

torch.eq(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.eq(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.eq(a : string,
         b : string) -> bool

torch.eq(a : List[int],
         b : List[int]) -> bool

torch.eq(a : List[float],
         b : List[float]) -> bool

torch.eq(a : List[Tensor],
         b : List[Tensor]) -> bool

torch.eq(a : int,
         b : int) -> bool

torch.eq(a : float,
         b : float) -> bool

torch.eq(a : int,
         b : float) -> bool

torch.eq(a : float,
         b : int) -> bool

torch.equal(self : Tensor,
            other : Tensor) -> bool

torch.erf(self : Tensor,
          out : Tensor) -> Tensor

torch.erf(self : Tensor) -> Tensor

torch.erf_(self : Tensor) -> Tensor

torch.erfc(self : Tensor,
           out : Tensor) -> Tensor

torch.erfc(self : Tensor) -> Tensor

torch.erfc_(self : Tensor) -> Tensor

torch.erfinv(self : Tensor,
             out : Tensor) -> Tensor

torch.erfinv(self : Tensor) -> Tensor

torch.exp(self : Tensor) -> Tensor

torch.exp(self : Tensor,
          out : Tensor) -> Tensor

torch.exp_(self : Tensor) -> Tensor

torch.expm1(self : Tensor,
            out : Tensor) -> Tensor

torch.expm1(self : Tensor) -> Tensor

torch.expm1_(self : Tensor) -> Tensor

torch.eye(n : int,
          out : Tensor) -> Tensor

torch.eye(n : int,
          m : int,
          out : Tensor) -> Tensor

torch.eye(n : int,
          dtype : int=6,
          layout : int=0,
          device : List[int]=[0, -1]) -> Tensor

torch.eye(n : int,
          m : int,
          dtype : int=6,
          layout : int=0,
          device : List[int]=[0, -1]) -> Tensor

torch.feature_alpha_dropout(input : Tensor,
                            p : float,
                            train : bool) -> Tensor

torch.feature_alpha_dropout_(self : Tensor,
                             p : float,
                             train : bool) -> Tensor

torch.feature_dropout(input : Tensor,
                      p : float,
                      train : bool) -> Tensor

torch.feature_dropout_(self : Tensor,
                       p : float,
                       train : bool) -> Tensor

torch.fft(self : Tensor,
          signal_ndim : int,
          normalized : bool=False) -> Tensor

torch.fill_(self : Tensor,
            value : Tensor) -> Tensor

torch.fill_(self : Tensor,
            value : Scalar) -> Tensor

torch.flatten(self : Tensor,
              start_dim : int=0,
              end_dim : int=-1) -> Tensor

torch.flip(self : Tensor,
           dims : List[int]) -> Tensor

torch.floor(self : Tensor) -> Tensor

torch.floor(self : Tensor,
            out : Tensor) -> Tensor

torch.floor_(self : Tensor) -> Tensor

torch.fmod(self : Tensor,
           other : Tensor,
           out : Tensor) -> Tensor

torch.fmod(self : Tensor,
           other : Scalar,
           out : Tensor) -> Tensor

torch.fmod(self : Tensor,
           other : Tensor) -> Tensor

torch.fmod(self : Tensor,
           other : Scalar) -> Tensor

torch.frac(self : Tensor) -> Tensor

torch.frac(self : Tensor,
           out : Tensor) -> Tensor

torch.frobenius_norm(self : Tensor) -> Tensor

torch.frobenius_norm(self : Tensor,
                     dim : List[int],
                     keepdim : bool=False) -> Tensor

torch.frobenius_norm(self : Tensor,
                     dim : List[int],
                     keepdim : bool=False,
                     out : Tensor) -> Tensor

torch.full(size : List[int],
           fill_value : Scalar,
           dtype : int=6,
           layout : int=0,
           device : List[int]=[0, -1]) -> Tensor

torch.full(size : List[int],
           fill_value : Scalar,
           out : Tensor) -> Tensor

torch.full_like(self : Tensor,
                fill_value : Scalar) -> Tensor

torch.full_like(self : Tensor,
                fill_value : Scalar,
                dtype : int=6,
                layout : int=0,
                device : List[int]=[0, -1]) -> Tensor

torch.gather(self : Tensor,
             dim : int,
             index : Tensor,
             out : Tensor) -> Tensor

torch.gather(self : Tensor,
             dim : int,
             index : Tensor) -> Tensor

torch.ge(self : Tensor,
         other : Tensor) -> Tensor

torch.ge(self : Tensor,
         other : Scalar) -> Tensor

torch.ge(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.ge(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.ge(a : int,
         b : int) -> bool

torch.ge(a : float,
         b : float) -> bool

torch.ge(a : int,
         b : float) -> bool

torch.ge(a : float,
         b : int) -> bool

torch.gels(self : Tensor,
           A : Tensor) -> Tuple[Tensor, Tensor]

torch.geqrf(self : Tensor) -> Tuple[Tensor, Tensor]

torch.ger(self : Tensor,
          vec2 : Tensor) -> Tensor

torch.ger(self : Tensor,
          vec2 : Tensor,
          out : Tensor) -> Tensor

torch.gesv(self : Tensor,
           A : Tensor) -> Tuple[Tensor, Tensor]

torch.get_device(self : Tensor) -> int

torch.get_device(self : Tensor) -> int

torch.get_device(self : Tensor) -> int

torch.grid_sampler(input : Tensor,
                   grid : Tensor,
                   interpolation_mode : int,
                   padding_mode : int) -> Tensor

torch.grid_sampler_2d(input : Tensor,
                      grid : Tensor,
                      interpolation_mode : int,
                      padding_mode : int) -> Tensor

torch.grid_sampler_3d(input : Tensor,
                      grid : Tensor,
                      interpolation_mode : int,
                      padding_mode : int) -> Tensor

torch.group_norm(input : Tensor,
                 num_groups : int,
                 weight : Optional[Tensor],
                 bias : Optional[Tensor],
                 eps : float=1e-05,
                 cudnn_enabled : bool=True) -> Tensor

torch.gru(data : Tensor,
          batch_sizes : Tensor,
          hx : Tensor,
          params : List[Tensor],
          has_biases : bool,
          num_layers : int,
          dropout : float,
          train : bool,
          bidirectional : bool) -> Tuple[Tensor, Tensor]

torch.gru(input : Tensor,
          hx : Tensor,
          params : List[Tensor],
          has_biases : bool,
          num_layers : int,
          dropout : float,
          train : bool,
          bidirectional : bool,
          batch_first : bool) -> Tuple[Tensor, Tensor]

torch.gru_cell(input : Tensor,
               hx : Tensor,
               w_ih : Tensor,
               w_hh : Tensor,
               b_ih : Optional[Tensor],
               b_hh : Optional[Tensor]) -> Tensor

torch.gt(self : Tensor,
         other : Tensor) -> Tensor

torch.gt(self : Tensor,
         other : Scalar) -> Tensor

torch.gt(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.gt(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.gt(a : int,
         b : int) -> bool

torch.gt(a : float,
         b : float) -> bool

torch.gt(a : int,
         b : float) -> bool

torch.gt(a : float,
         b : int) -> bool

torch.hamming_window(window_length : int,
                     dtype : int=6,
                     layout : int=0,
                     device : List[int]=[0, -1]) -> Tensor

torch.hamming_window(window_length : int,
                     periodic : bool,
                     dtype : int=6,
                     layout : int=0,
                     device : List[int]=[0, -1]) -> Tensor

torch.hamming_window(window_length : int,
                     periodic : bool,
                     alpha : float,
                     dtype : int=6,
                     layout : int=0,
                     device : List[int]=[0, -1]) -> Tensor

torch.hamming_window(window_length : int,
                     periodic : bool,
                     alpha : float,
                     beta : float,
                     dtype : int=6,
                     layout : int=0,
                     device : List[int]=[0, -1]) -> Tensor

torch.hann_window(window_length : int,
                  dtype : int=6,
                  layout : int=0,
                  device : List[int]=[0, -1]) -> Tensor

torch.hann_window(window_length : int,
                  periodic : bool,
                  dtype : int=6,
                  layout : int=0,
                  device : List[int]=[0, -1]) -> Tensor

torch.hardshrink(self : Tensor,
                 lambd : Scalar=0.5) -> Tensor

torch.hinge_embedding_loss(self : Tensor,
                           target : Tensor,
                           margin : float=1.0,
                           reduction : int=1) -> Tensor

torch.histc(self : Tensor,
            bins : int=100,
            min : Scalar=0,
            max : Scalar=0,
            out : Tensor) -> Tensor

torch.histc(self : Tensor,
            bins : int=100,
            min : Scalar=0,
            max : Scalar=0) -> Tensor

torch.hspmm(mat1 : Tensor,
            mat2 : Tensor) -> Tensor

torch.hspmm(mat1 : Tensor,
            mat2 : Tensor,
            out : Tensor) -> Tensor

torch.ifft(self : Tensor,
           signal_ndim : int,
           normalized : bool=False) -> Tensor

torch.index_put(self : Tensor,
                indices : List[Tensor],
                values : Tensor) -> Tensor

torch.index_put_(self : Tensor,
                 indices : List[Tensor],
                 values : Tensor) -> Tensor

torch.index_select(self : Tensor,
                   dim : int,
                   index : Tensor,
                   out : Tensor) -> Tensor

torch.index_select(self : Tensor,
                   dim : int,
                   index : Tensor) -> Tensor

torch.instance_norm(input : Tensor,
                    weight : Optional[Tensor],
                    bias : Optional[Tensor],
                    running_mean : Optional[Tensor],
                    running_var : Optional[Tensor],
                    use_input_stats : bool,
                    momentum : float,
                    eps : float,
                    cudnn_enabled : bool) -> Tensor

torch.inverse(self : Tensor,
              out : Tensor) -> Tensor

torch.inverse(self : Tensor) -> Tensor

torch.irfft(self : Tensor,
            signal_ndim : int,
            normalized : bool=False,
            onesided : bool=True,
            signal_sizes : List[int]=[]) -> Tensor

torch.is_complex(self : Tensor) -> bool

torch.is_distributed(self : Tensor) -> bool

torch.is_floating_point(self : Tensor) -> bool

torch.is_nonzero(self : Tensor) -> bool

torch.is_same_size(self : Tensor,
                   other : Tensor) -> bool

torch.is_signed(self : Tensor) -> bool

torch.isclose(self : Tensor,
              other : Tensor,
              rtol : float=1e-05,
              atol : float=1e-08,
              equal_nan : bool=False) -> Tensor

torch.kl_div(self : Tensor,
             target : Tensor,
             reduction : int=1) -> Tensor

torch.kthvalue(self : Tensor,
               k : int,
               dim : int=-1,
               keepdim : bool=False) -> Tuple[Tensor, Tensor]

torch.layer_norm(input : Tensor,
                 normalized_shape : List[int],
                 weight : Optional[Tensor],
                 bias : Optional[Tensor],
                 eps : float=1e-05,
                 cudnn_enable : bool=True) -> Tensor

torch.le(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.le(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.le(self : Tensor,
         other : Tensor) -> Tensor

torch.le(self : Tensor,
         other : Scalar) -> Tensor

torch.le(a : int,
         b : int) -> bool

torch.le(a : float,
         b : float) -> bool

torch.le(a : int,
         b : float) -> bool

torch.le(a : float,
         b : int) -> bool

torch.lerp(self : Tensor,
           end : Tensor,
           weight : Scalar) -> Tensor

torch.lerp(self : Tensor,
           end : Tensor,
           weight : Scalar,
           out : Tensor) -> Tensor

torch.lgamma(self : Tensor,
             out : Tensor) -> Tensor

torch.lgamma(self : Tensor) -> Tensor

torch.linspace(start : Scalar,
               end : Scalar,
               dtype : int=6,
               layout : int=0,
               device : List[int]=[0, -1]) -> Tensor

torch.linspace(start : Scalar,
               end : Scalar,
               steps : int,
               dtype : int=6,
               layout : int=0,
               device : List[int]=[0, -1]) -> Tensor

torch.linspace(start : Scalar,
               end : Scalar,
               out : Tensor) -> Tensor

torch.linspace(start : Scalar,
               end : Scalar,
               steps : int,
               out : Tensor) -> Tensor

torch.log(self : Tensor) -> Tensor

torch.log(self : Tensor,
          out : Tensor) -> Tensor

torch.log10(self : Tensor,
            out : Tensor) -> Tensor

torch.log10(self : Tensor) -> Tensor

torch.log10_(self : Tensor) -> Tensor

torch.log1p(self : Tensor) -> Tensor

torch.log1p(self : Tensor,
            out : Tensor) -> Tensor

torch.log1p_(self : Tensor) -> Tensor

torch.log2(self : Tensor) -> Tensor

torch.log2(self : Tensor,
           out : Tensor) -> Tensor

torch.log2_(self : Tensor) -> Tensor

torch.log_(self : Tensor) -> Tensor

torch.log_softmax(self : Tensor,
                  dim : int) -> Tensor

torch.log_softmax(self : Tensor,
                  dim : int,
                  dtype : int) -> Tensor

torch.logdet(self : Tensor) -> Tensor

torch.logspace(start : Scalar,
               end : Scalar,
               dtype : int=6,
               layout : int=0,
               device : List[int]=[0, -1]) -> Tensor

torch.logspace(start : Scalar,
               end : Scalar,
               steps : int,
               dtype : int=6,
               layout : int=0,
               device : List[int]=[0, -1]) -> Tensor

torch.logspace(start : Scalar,
               end : Scalar,
               out : Tensor) -> Tensor

torch.logspace(start : Scalar,
               end : Scalar,
               steps : int,
               out : Tensor) -> Tensor

torch.logsumexp(self : Tensor,
                dim : int,
                keepdim : bool=False) -> Tensor

torch.logsumexp(self : Tensor,
                dim : int,
                keepdim : bool=False,
                out : Tensor) -> Tensor

torch.lstm(data : Tensor,
           batch_sizes : Tensor,
           hx : List[Tensor],
           params : List[Tensor],
           has_biases : bool,
           num_layers : int,
           dropout : float,
           train : bool,
           bidirectional : bool) -> Tuple[Tensor, Tensor, Tensor]

torch.lstm(input : Tensor,
           hx : List[Tensor],
           params : List[Tensor],
           has_biases : bool,
           num_layers : int,
           dropout : float,
           train : bool,
           bidirectional : bool,
           batch_first : bool) -> Tuple[Tensor, Tensor, Tensor]

torch.lstm_cell(input : Tensor,
                hx : List[Tensor],
                w_ih : Tensor,
                w_hh : Tensor,
                b_ih : Optional[Tensor],
                b_hh : Optional[Tensor]) -> Tuple[Tensor, Tensor]

torch.lt(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.lt(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.lt(self : Tensor,
         other : Tensor) -> Tensor

torch.lt(self : Tensor,
         other : Scalar) -> Tensor

torch.lt(a : int,
         b : int) -> bool

torch.lt(a : float,
         b : float) -> bool

torch.lt(a : int,
         b : float) -> bool

torch.lt(a : float,
         b : int) -> bool

torch.margin_ranking_loss(input1 : Tensor,
                          input2 : Tensor,
                          target : Tensor,
                          margin : float=0.0,
                          reduction : int=1) -> Tensor

torch.masked_select(self : Tensor,
                    mask : Tensor,
                    out : Tensor) -> Tensor

torch.masked_select(self : Tensor,
                    mask : Tensor) -> Tensor

torch.matmul(self : Tensor,
             other : Tensor,
             out : Tensor) -> Tensor

torch.matmul(self : Tensor,
             other : Tensor) -> Tensor

torch.matrix_power(self : Tensor,
                   n : int) -> Tensor

torch.matrix_rank(self : Tensor,
                  symmetric : bool=False) -> Tensor

torch.matrix_rank(self : Tensor,
                  tol : float,
                  symmetric : bool=False) -> Tensor

torch.max(self : Tensor,
          other : Tensor,
          out : Tensor) -> Tensor

torch.max(self : Tensor) -> Tensor

torch.max(self : Tensor,
          other : Tensor) -> Tensor

torch.max(self : Tensor,
          dim : int,
          keepdim : bool=False) -> Tuple[Tensor, Tensor]

torch.max_pool1d_with_indices(self : Tensor,
                              kernel_size : List[int],
                              stride : List[int]=[],
                              padding : List[int]=[0],
                              dilation : List[int]=[1],
                              ceil_mode : bool=False) -> Tuple[Tensor, Tensor]

torch.mean(self : Tensor) -> Tensor

torch.mean(self : Tensor,
           dtype : int) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           keepdim : bool=False) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           dtype : int) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           keepdim : bool,
           dtype : int) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           keepdim : bool=False,
           out : Tensor) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           dtype : int,
           out : Tensor) -> Tensor

torch.mean(self : Tensor,
           dim : int,
           keepdim : bool,
           dtype : int,
           out : Tensor) -> Tensor

torch.median(self : Tensor) -> Tensor

torch.median(self : Tensor,
             dim : int,
             keepdim : bool=False) -> Tuple[Tensor, Tensor]

torch.meshgrid(tensors : List[Tensor]) -> List[Tensor]

torch.min(self : Tensor) -> Tensor

torch.min(self : Tensor,
          other : Tensor) -> Tensor

torch.min(self : Tensor,
          dim : int,
          keepdim : bool=False) -> Tuple[Tensor, Tensor]

torch.min(self : Tensor,
          other : Tensor,
          out : Tensor) -> Tensor

torch.miopen_batch_norm(input : Tensor,
                        weight : Tensor,
                        bias : Optional[Tensor],
                        running_mean : Optional[Tensor],
                        running_var : Optional[Tensor],
                        training : bool,
                        exponential_average_factor : float,
                        epsilon : float) -> Tuple[Tensor, Tensor, Tensor]

torch.miopen_convolution(self : Tensor,
                         weight : Tensor,
                         bias : Optional[Tensor],
                         padding : List[int],
                         stride : List[int],
                         dilation : List[int],
                         groups : int,
                         benchmark : bool,
                         deterministic : bool) -> Tensor

torch.miopen_convolution_transpose(self : Tensor,
                                   weight : Tensor,
                                   bias : Optional[Tensor],
                                   padding : List[int],
                                   output_padding : List[int],
                                   stride : List[int],
                                   dilation : List[int],
                                   groups : int,
                                   benchmark : bool,
                                   deterministic : bool) -> Tensor

torch.mkldnn_convolution(self : Tensor,
                         weight : Tensor,
                         bias : Optional[Tensor],
                         padding : List[int],
                         stride : List[int],
                         dilation : List[int],
                         groups : int) -> Tensor

torch.mkldnn_convolution_backward_weights(weight_size : List[int],
                                          grad_output : Tensor,
                                          self : Tensor,
                                          padding : List[int],
                                          stride : List[int],
                                          dilation : List[int],
                                          groups : int,
                                          bias_defined : bool) -> Tuple[Tensor, Tensor]

torch.mm(self : Tensor,
         mat2 : Tensor,
         out : Tensor) -> Tensor

torch.mm(self : Tensor,
         mat2 : Tensor) -> Tensor

torch.mode(self : Tensor,
           dim : int=-1,
           keepdim : bool=False) -> Tuple[Tensor, Tensor]

torch.mul(self : Tensor,
          other : Tensor) -> Tensor

torch.mul(self : Tensor,
          other : Scalar) -> Tensor

torch.mul(self : Tensor,
          other : Tensor,
          out : Tensor) -> Tensor

torch.mul(a : int,
          b : int) -> int

torch.mul(a : float,
          b : float) -> float

torch.mul(a : int,
          b : float) -> float

torch.mul(a : float,
          b : int) -> float

torch.multinomial(self : Tensor,
                  num_samples : int,
                  replacement : bool=False,
                  generator : Generator) -> Tensor

torch.multinomial(self : Tensor,
                  num_samples : int,
                  replacement : bool=False,
                  generator : Generator,
                  out : Tensor) -> Tensor

torch.mv(self : Tensor,
         vec : Tensor,
         out : Tensor) -> Tensor

torch.mv(self : Tensor,
         vec : Tensor) -> Tensor

torch.mvlgamma(self : Tensor,
               p : int) -> Tensor

torch.narrow(self : Tensor,
             dim : int,
             start : int,
             length : int) -> Tensor

torch.native_batch_norm(input : Tensor,
                        weight : Optional[Tensor],
                        bias : Optional[Tensor],
                        running_mean : Optional[Tensor],
                        running_var : Optional[Tensor],
                        training : bool,
                        momentum : float,
                        eps : float) -> Tuple[Tensor, Tensor, Tensor]

torch.native_clone(self : Tensor) -> Tensor

torch.native_norm(self : Tensor,
                  p : Scalar=2) -> Tensor

torch.native_pow(self : Tensor,
                 exponent : Scalar) -> Tensor

torch.native_pow(self : Tensor,
                 exponent : Scalar,
                 out : Tensor) -> Tensor

torch.native_resize_as_(self : Tensor,
                        the_template : Tensor) -> Tensor

torch.native_zero_(self : Tensor) -> Tensor

torch.ne(self : Tensor,
         other : Tensor) -> Tensor

torch.ne(self : Tensor,
         other : Scalar) -> Tensor

torch.ne(self : Tensor,
         other : Tensor,
         out : Tensor) -> Tensor

torch.ne(self : Tensor,
         other : Scalar,
         out : Tensor) -> Tensor

torch.ne(a : string,
         b : string) -> bool

torch.ne(a : int,
         b : int) -> bool

torch.ne(a : float,
         b : float) -> bool

torch.ne(a : int,
         b : float) -> bool

torch.ne(a : float,
         b : int) -> bool

torch.neg(self : Tensor,
          out : Tensor) -> Tensor

torch.neg(self : Tensor) -> Tensor

torch.neg(self : int) -> int

torch.neg(self : float) -> float

torch.nonzero(self : Tensor,
              out : Tensor) -> Tensor

torch.nonzero(self : Tensor) -> Tensor

torch.norm(self : Tensor,
           p : Scalar=2) -> Tensor

torch.norm(self : Tensor,
           p : Scalar,
           dim : int,
           keepdim : bool=False) -> Tensor

torch.norm(self : Tensor,
           p : Scalar,
           dim : int,
           keepdim : bool=False,
           out : Tensor) -> Tensor

torch.norm_except_dim(v : Tensor,
                      pow : int=2,
                      dim : int=0) -> Tensor

torch.normal(mean : Tensor,
             std : Tensor,
             generator : Generator) -> Tensor

torch.normal(mean : float,
             std : Tensor,
             generator : Generator) -> Tensor

torch.normal(mean : Tensor,
             std : float=1.0,
             generator : Generator) -> Tensor

torch.normal(mean : Tensor,
             std : Tensor,
             generator : Generator,
             out : Tensor) -> Tensor

torch.normal(mean : float,
             std : Tensor,
             generator : Generator,
             out : Tensor) -> Tensor

torch.normal(mean : Tensor,
             std : float=1.0,
             generator : Generator,
             out : Tensor) -> Tensor

torch.nuclear_norm(self : Tensor,
                   keepdim : bool=False) -> Tensor

torch.nuclear_norm(self : Tensor,
                   keepdim : bool=False,
                   out : Tensor) -> Tensor

torch.numel(self : Tensor) -> int

torch.ones(size : List[int],
           out : Tensor) -> Tensor

torch.ones(size : List[int],
           dtype : int=6,
           layout : int=0,
           device : List[int]=[0, -1]) -> Tensor

torch.ones_like(self : Tensor) -> Tensor

torch.ones_like(self : Tensor,
                dtype : int=6,
                layout : int=0,
                device : List[int]=[0, -1]) -> Tensor

torch.orgqr(self : Tensor,
            input2 : Tensor) -> Tensor

torch.orgqr(self : Tensor,
            input2 : Tensor,
            out : Tensor) -> Tensor

torch.ormqr(self : Tensor,
            input2 : Tensor,
            input3 : Tensor,
            left : bool=True,
            transpose : bool=False) -> Tensor

torch.ormqr(self : Tensor,
            input2 : Tensor,
            input3 : Tensor,
            left : bool=True,
            transpose : bool=False,
            out : Tensor) -> Tensor

torch.pairwise_distance(x1 : Tensor,
                        x2 : Tensor,
                        p : float=2.0,
                        eps : float=1e-06,
                        keepdim : bool=False) -> Tensor

torch.pdist(self : Tensor,
            p : float=2.0) -> Tensor

torch.pin_memory(self : Tensor) -> Tensor

torch.pinverse(self : Tensor,
               rcond : float=1e-15) -> Tensor

torch.pixel_shuffle(self : Tensor,
                    upscale_factor : int) -> Tensor

torch.poisson(self : Tensor,
              generator : Generator) -> Tensor

torch.polygamma(n : int,
                self : Tensor) -> Tensor

torch.polygamma(n : int,
                self : Tensor,
                out : Tensor) -> Tensor

torch.potri(self : Tensor,
            upper : bool=True) -> Tensor

torch.potri(self : Tensor,
            upper : bool=True,
            out : Tensor) -> Tensor

torch.potrs(self : Tensor,
            input2 : Tensor,
            upper : bool=True) -> Tensor

torch.potrs(self : Tensor,
            input2 : Tensor,
            upper : bool=True,
            out : Tensor) -> Tensor

torch.pow(self : Tensor,
          exponent : Tensor) -> Tensor

torch.pow(self : Scalar,
          exponent : Tensor) -> Tensor

torch.pow(self : Tensor,
          exponent : Scalar) -> Tensor

torch.pow(self : Tensor,
          exponent : Tensor,
          out : Tensor) -> Tensor

torch.pow(self : Scalar,
          exponent : Tensor,
          out : Tensor) -> Tensor

torch.pow(self : Tensor,
          exponent : Scalar,
          out : Tensor) -> Tensor

torch.pow(a : int,
          b : int) -> int

torch.pow(a : float,
          b : float) -> float

torch.pow(a : int,
          b : float) -> float

torch.pow(a : float,
          b : int) -> float

torch.prelu(self : Tensor,
            weight : Tensor) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           keepdim : bool=False,
           out : Tensor) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           dtype : int,
           out : Tensor) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           keepdim : bool,
           dtype : int,
           out : Tensor) -> Tensor

torch.prod(self : Tensor) -> Tensor

torch.prod(self : Tensor,
           dtype : int) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           keepdim : bool=False) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           dtype : int) -> Tensor

torch.prod(self : Tensor,
           dim : int,
           keepdim : bool,
           dtype : int) -> Tensor

torch.pstrf(self : Tensor,
            upper : bool=True,
            tol : Scalar=-1) -> Tuple[Tensor, Tensor]

torch.qr(self : Tensor) -> Tuple[Tensor, Tensor]

torch.rand(size : List[int],
           dtype : int=6,
           layout : int=0,
           device : List[int]=[0, -1]) -> Tensor

torch.rand(size : List[int],
           out : Tensor) -> Tensor

torch.rand_like(self : Tensor) -> Tensor

torch.rand_like(self : Tensor,
                dtype : int=6,
                layout : int=0,
                device : List[int]=[0, -1]) -> Tensor

torch.randint(high : int,
              size : List[int],
              out : Tensor) -> Tensor

torch.randint(low : int,
              high : int,
              size : List[int],
              out : Tensor) -> Tensor

torch.randint(high : int,
              size : List[int],
              dtype : int=6,
              layout : int=0,
              device : List[int]=[0, -1]) -> Tensor

torch.randint(low : int,
              high : int,
              size : List[int],
              dtype : int=6,
              layout : int=0,
              device : List[int]=[0, -1]) -> Tensor

torch.randint_like(self : Tensor,
                   high : int) -> Tensor

torch.randint_like(self : Tensor,
                   low : int,
                   high : int) -> Tensor

torch.randint_like(self : Tensor,
                   high : int,
                   dtype : int=6,
                   layout : int=0,
                   device : List[int]=[0, -1]) -> Tensor

torch.randint_like(self : Tensor,
                   low : int,
                   high : int,
                   dtype : int=6,
                   layout : int=0,
                   device : List[int]=[0, -1]) -> Tensor

torch.randn(size : List[int],
            dtype : int=6,
            layout : int=0,
            device : List[int]=[0, -1]) -> Tensor

torch.randn(size : List[int],
            out : Tensor) -> Tensor

torch.randn_like(self : Tensor) -> Tensor

torch.randn_like(self : Tensor,
                 dtype : int=6,
                 layout : int=0,
                 device : List[int]=[0, -1]) -> Tensor

torch.randperm(n : int,
               out : Tensor) -> Tensor

torch.randperm(n : int,
               dtype : int=6,
               layout : int=0,
               device : List[int]=[0, -1]) -> Tensor

torch.range(start : Scalar,
            end : Scalar,
            dtype : int=6,
            layout : int=0,
            device : List[int]=[0, -1]) -> Tensor

torch.range(start : Scalar,
            end : Scalar,
            step : Scalar,
            dtype : int=6,
            layout : int=0,
            device : List[int]=[0, -1]) -> Tensor

torch.range(start : Scalar,
            end : Scalar,
            out : Tensor) -> Tensor

torch.range(start : Scalar,
            end : Scalar,
            step : Scalar,
            out : Tensor) -> Tensor

torch.reciprocal(self : Tensor) -> Tensor

torch.reciprocal(self : Tensor,
                 out : Tensor) -> Tensor

torch.relu(self : Tensor) -> Tensor

torch.relu_(self : Tensor) -> Tensor

torch.remainder(self : Tensor,
                other : Tensor) -> Tensor

torch.remainder(self : Tensor,
                other : Scalar) -> Tensor

torch.remainder(self : Tensor,
                other : Tensor,
                out : Tensor) -> Tensor

torch.remainder(self : Tensor,
                other : Scalar,
                out : Tensor) -> Tensor

torch.remainder(a : int,
                b : int) -> int

torch.remainder(a : float,
                b : float) -> float

torch.remainder(a : int,
                b : float) -> float

torch.remainder(a : float,
                b : int) -> float

torch.renorm(self : Tensor,
             p : Scalar,
             dim : int,
             maxnorm : Scalar,
             out : Tensor) -> Tensor

torch.renorm(self : Tensor,
             p : Scalar,
             dim : int,
             maxnorm : Scalar) -> Tensor

torch.reshape(self : Tensor,
              shape : List[int]) -> Tensor

torch.resize_as_(self : Tensor,
                 the_template : Tensor) -> Tensor

torch.rfft(self : Tensor,
           signal_ndim : int,
           normalized : bool=False,
           onesided : bool=True) -> Tensor

torch.rnn_relu(data : Tensor,
               batch_sizes : Tensor,
               hx : Tensor,
               params : List[Tensor],
               has_biases : bool,
               num_layers : int,
               dropout : float,
               train : bool,
               bidirectional : bool) -> Tuple[Tensor, Tensor]

torch.rnn_relu(input : Tensor,
               hx : Tensor,
               params : List[Tensor],
               has_biases : bool,
               num_layers : int,
               dropout : float,
               train : bool,
               bidirectional : bool,
               batch_first : bool) -> Tuple[Tensor, Tensor]

torch.rnn_relu_cell(input : Tensor,
                    hx : Tensor,
                    w_ih : Tensor,
                    w_hh : Tensor,
                    b_ih : Optional[Tensor],
                    b_hh : Optional[Tensor]) -> Tensor

torch.rnn_tanh(data : Tensor,
               batch_sizes : Tensor,
               hx : Tensor,
               params : List[Tensor],
               has_biases : bool,
               num_layers : int,
               dropout : float,
               train : bool,
               bidirectional : bool) -> Tuple[Tensor, Tensor]

torch.rnn_tanh(input : Tensor,
               hx : Tensor,
               params : List[Tensor],
               has_biases : bool,
               num_layers : int,
               dropout : float,
               train : bool,
               bidirectional : bool,
               batch_first : bool) -> Tuple[Tensor, Tensor]

torch.rnn_tanh_cell(input : Tensor,
                    hx : Tensor,
                    w_ih : Tensor,
                    w_hh : Tensor,
                    b_ih : Optional[Tensor],
                    b_hh : Optional[Tensor]) -> Tensor

torch.roll(self : Tensor,
           shifts : List[int],
           dims : List[int]=[]) -> Tensor

torch.rot90(self : Tensor,
            k : int=1,
            dims : List[int]=[0, 1]) -> Tensor

torch.round(self : Tensor) -> Tensor

torch.round(self : Tensor,
            out : Tensor) -> Tensor

torch.round_(self : Tensor) -> Tensor

torch.rrelu(self : Tensor,
            lower : Scalar=0.125,
            upper : Scalar=0.3333333333333333,
            training : bool=False,
            generator : Generator) -> Tensor

torch.rrelu_(self : Tensor,
             lower : Scalar=0.125,
             upper : Scalar=0.3333333333333333,
             training : bool=False,
             generator : Generator) -> Tensor

torch.rsqrt(self : Tensor,
            out : Tensor) -> Tensor

torch.rsqrt(self : Tensor) -> Tensor

torch.rsqrt_(self : Tensor) -> Tensor

torch.rsub(self : Tensor,
           other : Tensor,
           alpha : Scalar=1) -> Tensor

torch.rsub(self : Tensor,
           other : Scalar,
           alpha : Scalar=1) -> Tensor

torch.s_native_addmm(self : Tensor,
                     mat1 : Tensor,
                     mat2 : Tensor,
                     beta : Scalar=1,
                     alpha : Scalar=1) -> Tensor

torch.s_native_addmm(self : Tensor,
                     mat1 : Tensor,
                     mat2 : Tensor,
                     beta : Scalar=1,
                     alpha : Scalar=1,
                     out : Tensor) -> Tensor

torch.s_native_addmm_(self : Tensor,
                      mat1 : Tensor,
                      mat2 : Tensor,
                      beta : Scalar=1,
                      alpha : Scalar=1) -> Tensor

torch.select(self : Tensor,
             dim : int,
             index : int) -> Tensor

torch.select(a : List[int],
             b : int) -> int

torch.select(a : List[float],
             b : int) -> float

torch.select(a : List[Tensor],
             b : int) -> Tensor

torch.select(a : List[t],
             b : int) -> t

torch.selu(self : Tensor) -> Tensor

torch.selu_(self : Tensor) -> Tensor

torch.sigmoid(self : Tensor) -> Tensor

torch.sigmoid(self : Tensor,
              out : Tensor) -> Tensor

torch.sigmoid_(self : Tensor) -> Tensor

torch.sign(self : Tensor) -> Tensor

torch.sign(self : Tensor,
           out : Tensor) -> Tensor

torch.sin(self : Tensor) -> Tensor

torch.sin(self : Tensor,
          out : Tensor) -> Tensor

torch.sin_(self : Tensor) -> Tensor

torch.sinh(self : Tensor,
           out : Tensor) -> Tensor

torch.sinh(self : Tensor) -> Tensor

torch.sinh_(self : Tensor) -> Tensor

torch.slogdet(self : Tensor) -> Tuple[Tensor, Tensor]

torch.smm(self : Tensor,
          mat2 : Tensor) -> Tensor

torch.softmax(self : Tensor,
              dim : int) -> Tensor

torch.softmax(self : Tensor,
              dim : int,
              dtype : int) -> Tensor

torch.sort(self : Tensor,
           dim : int=-1,
           descending : bool=False) -> Tuple[Tensor, Tensor]

torch.sparse_coo_tensor(size : List[int],
                        dtype : int=6,
                        layout : int=0,
                        device : List[int]=[0, -1]) -> Tensor

torch.sparse_coo_tensor(indices : Tensor,
                        values : Tensor,
                        dtype : int=6,
                        layout : int=0,
                        device : List[int]=[0, -1]) -> Tensor

torch.sparse_coo_tensor(indices : Tensor,
                        values : Tensor,
                        size : List[int],
                        dtype : int=6,
                        layout : int=0,
                        device : List[int]=[0, -1]) -> Tensor

torch.split(self : Tensor,
            split_size : int,
            dim : int=0) -> List[Tensor]

torch.split(self : Tensor,
            split_sizes : List[int],
            dim : int=0) -> List[Tensor]

torch.split_with_sizes(self : Tensor,
                       split_sizes : List[int],
                       dim : int=0) -> List[Tensor]

torch.sqrt(self : Tensor,
           out : Tensor) -> Tensor

torch.sqrt(self : Tensor) -> Tensor

torch.sqrt_(self : Tensor) -> Tensor

torch.squeeze(self : Tensor) -> Tensor

torch.squeeze(self : Tensor,
              dim : int) -> Tensor

torch.sspaddmm(self : Tensor,
               mat1 : Tensor,
               mat2 : Tensor,
               beta : Scalar=1,
               alpha : Scalar=1,
               out : Tensor) -> Tensor

torch.sspaddmm(self : Tensor,
               mat1 : Tensor,
               mat2 : Tensor,
               beta : Scalar=1,
               alpha : Scalar=1) -> Tensor

torch.stack(tensors : List[Tensor],
            dim : int=0) -> Tensor

torch.stack(tensors : List[Tensor],
            dim : int=0,
            out : Tensor) -> Tensor

torch.std(self : Tensor,
          unbiased : bool=True) -> Tensor

torch.std(self : Tensor,
          dim : int,
          unbiased : bool=True,
          keepdim : bool=False) -> Tensor

torch.std(self : Tensor,
          dim : int,
          unbiased : bool=True,
          keepdim : bool=False,
          out : Tensor) -> Tensor

torch.stft(self : Tensor,
           n_fft : int,
           hop_length : int,
           win_length : int,
           window : Optional[Tensor],
           normalized : bool=False,
           onesided : bool=True) -> Tensor

torch.sub(self : Tensor,
          other : Tensor,
          alpha : Scalar=1) -> Tensor

torch.sub(self : Tensor,
          other : Scalar,
          alpha : Scalar=1) -> Tensor

torch.sub(self : Tensor,
          other : Tensor,
          alpha : Scalar=1,
          out : Tensor) -> Tensor

torch.sub(a : int,
          b : int) -> int

torch.sub(a : float,
          b : float) -> float

torch.sub(a : int,
          b : float) -> float

torch.sub(a : float,
          b : int) -> float

torch.sum(self : Tensor,
          dim : List[int],
          keepdim : bool=False,
          out : Tensor) -> Tensor

torch.sum(self : Tensor,
          dim : List[int],
          dtype : int,
          out : Tensor) -> Tensor

torch.sum(self : Tensor,
          dim : List[int],
          keepdim : bool,
          dtype : int,
          out : Tensor) -> Tensor

torch.sum(self : Tensor) -> Tensor

torch.sum(self : Tensor,
          dtype : int) -> Tensor

torch.sum(self : Tensor,
          dim : List[int],
          keepdim : bool=False) -> Tensor

torch.sum(self : Tensor,
          dim : List[int],
          dtype : int) -> Tensor

torch.sum(self : Tensor,
          dim : List[int],
          keepdim : bool,
          dtype : int) -> Tensor

torch.svd(self : Tensor,
          some : bool=True,
          compute_uv : bool=True) -> Tuple[Tensor, Tensor, Tensor]

torch.symeig(self : Tensor,
             eigenvectors : bool=False,
             upper : bool=True) -> Tuple[Tensor, Tensor]

torch.t(self : Tensor) -> Tensor

torch.take(self : Tensor,
           index : Tensor) -> Tensor

torch.take(self : Tensor,
           index : Tensor,
           out : Tensor) -> Tensor

torch.tan(self : Tensor,
          out : Tensor) -> Tensor

torch.tan(self : Tensor) -> Tensor

torch.tan_(self : Tensor) -> Tensor

torch.tanh(self : Tensor) -> Tensor

torch.tanh(self : Tensor,
           out : Tensor) -> Tensor

torch.tanh_(self : Tensor) -> Tensor

torch.tensordot(self : Tensor,
                other : Tensor,
                dims_self : List[int],
                dims_other : List[int]) -> Tensor

torch.threshold(self : Tensor,
                threshold : Scalar,
                value : Scalar) -> Tensor

torch.threshold(self : Tensor,
                threshold : Scalar,
                value : Scalar,
                out : Tensor) -> Tensor

torch.threshold_(self : Tensor,
                 threshold : Scalar,
                 value : Scalar) -> Tensor

torch.topk(self : Tensor,
           k : int,
           dim : int=-1,
           largest : bool=True,
           sorted : bool=True) -> Tuple[Tensor, Tensor]

torch.trace(self : Tensor) -> Tensor

torch.transpose(self : Tensor,
                dim0 : int,
                dim1 : int) -> Tensor

torch.tril(self : Tensor,
           diagonal : int=0,
           out : Tensor) -> Tensor

torch.tril(self : Tensor,
           diagonal : int=0) -> Tensor

torch.triplet_margin_loss(anchor : Tensor,
                          positive : Tensor,
                          negative : Tensor,
                          margin : float=1.0,
                          p : float=2.0,
                          eps : float=1e-06,
                          swap : bool=False,
                          reduction : int=1) -> Tensor

torch.triu(self : Tensor,
           diagonal : int=0,
           out : Tensor) -> Tensor

torch.triu(self : Tensor,
           diagonal : int=0) -> Tensor

torch.trtrs(self : Tensor,
            A : Tensor,
            upper : bool=True,
            transpose : bool=False,
            unitriangular : bool=False) -> Tuple[Tensor, Tensor]

torch.trunc(self : Tensor) -> Tensor

torch.trunc(self : Tensor,
            out : Tensor) -> Tensor

torch.trunc_(self : Tensor) -> Tensor

torch.unbind(self : Tensor,
             dim : int=0) -> List[Tensor]

torch.unsqueeze(self : Tensor,
                dim : int) -> Tensor

torch.var(self : Tensor,
          dim : int,
          unbiased : bool=True,
          keepdim : bool=False,
          out : Tensor) -> Tensor

torch.var(self : Tensor,
          unbiased : bool=True) -> Tensor

torch.var(self : Tensor,
          dim : int,
          unbiased : bool=True,
          keepdim : bool=False) -> Tensor

torch.wait(self : Future[t]) -> t

torch.where(condition : Tensor,
            self : Tensor,
            other : Tensor) -> Tensor

torch.zero_(self : Tensor) -> Tensor

torch.zeros(size : List[int],
            out : Tensor) -> Tensor

torch.zeros(size : List[int],
            dtype : int=6,
            layout : int=0,
            device : List[int]=[0, -1]) -> Tensor

torch.zeros_like(self : Tensor) -> Tensor

torch.zeros_like(self : Tensor,
                 dtype : int=6,
                 layout : int=0,
                 device : List[int]=[0, -1]) -> Tensor

torch.nn.functional.adaptive_avg_pool1d(self : Tensor,
                                        output_size : List[int]) -> Tensor

torch.nn.functional.adaptive_max_pool1d(self : Tensor,
                                        output_size : List[int]) -> Tuple[Tensor, Tensor]

torch.nn.functional.adaptive_max_pool2d(self : Tensor,
                                        output_size : List[int]) -> Tuple[Tensor, Tensor]

torch.nn.functional.adaptive_max_pool3d(self : Tensor,
                                        output_size : List[int]) -> Tuple[Tensor, Tensor]

torch.nn.functional.avg_pool1d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0],
                               ceil_mode : bool=False,
                               count_include_pad : bool=True) -> Tensor

torch.nn.functional.avg_pool2d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0, 0],
                               ceil_mode : bool=False,
                               count_include_pad : bool=True) -> Tensor

torch.nn.functional.avg_pool2d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0, 0],
                               ceil_mode : bool=False,
                               count_include_pad : bool=True,
                               out : Tensor) -> Tensor

torch.nn.functional.avg_pool3d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0, 0, 0],
                               ceil_mode : bool=False,
                               count_include_pad : bool=True) -> Tensor

torch.nn.functional.avg_pool3d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0, 0, 0],
                               ceil_mode : bool=False,
                               count_include_pad : bool=True,
                               out : Tensor) -> Tensor

torch.nn.functional.batch_norm(input : Tensor,
                               weight : Optional[Tensor],
                               bias : Optional[Tensor],
                               running_mean : Optional[Tensor],
                               running_var : Optional[Tensor],
                               training : bool,
                               momentum : float,
                               eps : float,
                               cudnn_enabled : bool) -> Tensor

torch.nn.functional.binary_cross_entropy(self : Tensor,
                                         target : Tensor,
                                         weight : Tensor,
                                         reduction : int=1,
                                         out : Tensor) -> Tensor

torch.nn.functional.binary_cross_entropy(self : Tensor,
                                         target : Tensor,
                                         weight : Tensor,
                                         reduction : int=1) -> Tensor

torch.nn.functional.binary_cross_entropy_with_logits(self : Tensor,
                                                     target : Tensor,
                                                     weight : Optional[Tensor],
                                                     pos_weight : Optional[Tensor],
                                                     reduction : int) -> Tensor

torch.nn.functional.celu_(self : Tensor,
                          alpha : Scalar=1.0) -> Tensor

torch.nn.functional.conv1d(input : Tensor,
                           weight : Tensor,
                           bias : Tensor,
                           stride : List[int]=[1],
                           padding : List[int]=[0],
                           dilation : List[int]=[1],
                           groups : int=1) -> Tensor

torch.nn.functional.conv2d(input : Tensor,
                           weight : Tensor,
                           bias : Tensor,
                           stride : List[int]=[1, 1],
                           padding : List[int]=[0, 0],
                           dilation : List[int]=[1, 1],
                           groups : int=1) -> Tensor

torch.nn.functional.conv3d(input : Tensor,
                           weight : Tensor,
                           bias : Tensor,
                           stride : List[int]=[1, 1, 1],
                           padding : List[int]=[0, 0, 0],
                           dilation : List[int]=[1, 1, 1],
                           groups : int=1) -> Tensor

torch.nn.functional.conv_tbc(self : Tensor,
                             weight : Tensor,
                             bias : Tensor,
                             pad : int=0) -> Tensor

torch.nn.functional.conv_transpose1d(input : Tensor,
                                     weight : Tensor,
                                     bias : Tensor,
                                     stride : List[int]=[1],
                                     padding : List[int]=[0],
                                     output_padding : List[int]=[0],
                                     groups : int=1,
                                     dilation : List[int]=[1]) -> Tensor

torch.nn.functional.conv_transpose2d(input : Tensor,
                                     weight : Tensor,
                                     bias : Tensor,
                                     stride : List[int]=[1, 1],
                                     padding : List[int]=[0, 0],
                                     output_padding : List[int]=[0, 0],
                                     groups : int=1,
                                     dilation : List[int]=[1, 1]) -> Tensor

torch.nn.functional.conv_transpose3d(input : Tensor,
                                     weight : Tensor,
                                     bias : Tensor,
                                     stride : List[int]=[1, 1, 1],
                                     padding : List[int]=[0, 0, 0],
                                     output_padding : List[int]=[0, 0, 0],
                                     groups : int=1,
                                     dilation : List[int]=[1, 1, 1]) -> Tensor

torch.nn.functional.cosine_embedding_loss(input1 : Tensor,
                                          input2 : Tensor,
                                          target : Tensor,
                                          margin : float=0.0,
                                          reduction : int=1) -> Tensor

torch.nn.functional.elu_(self : Tensor,
                         alpha : Scalar=1,
                         scale : Scalar=1,
                         input_scale : Scalar=1) -> Tensor

torch.nn.functional.embedding(weight : Tensor,
                              indices : Tensor,
                              padding_idx : int=-1,
                              scale_grad_by_freq : bool=False,
                              sparse : bool=False) -> Tensor

torch.nn.functional.embedding_bag(weight : Tensor,
                                  indices : Tensor,
                                  offsets : Tensor,
                                  scale_grad_by_freq : bool=False,
                                  mode : int=0,
                                  sparse : bool=False) -> Tuple[Tensor, Tensor, Tensor, Tensor]

torch.nn.functional.fractional_max_pool2d(self : Tensor,
                                          kernel_size : List[int],
                                          output_size : List[int],
                                          random_samples : Tensor) -> Tuple[Tensor, Tensor]

torch.nn.functional.glu(self : Tensor,
                        dim : int=-1) -> Tensor

torch.nn.functional.glu(self : Tensor,
                        dim : int=-1,
                        out : Tensor) -> Tensor

torch.nn.functional.group_norm(input : Tensor,
                               num_groups : int,
                               weight : Optional[Tensor],
                               bias : Optional[Tensor],
                               eps : float=1e-05,
                               cudnn_enabled : bool=True) -> Tensor

torch.nn.functional.hardtanh_(self : Tensor,
                              min_val : Scalar=-1,
                              max_val : Scalar=1) -> Tensor

torch.nn.functional.hinge_embedding_loss(self : Tensor,
                                         target : Tensor,
                                         margin : float=1.0,
                                         reduction : int=1) -> Tensor

torch.nn.functional.instance_norm(input : Tensor,
                                  weight : Optional[Tensor],
                                  bias : Optional[Tensor],
                                  running_mean : Optional[Tensor],
                                  running_var : Optional[Tensor],
                                  use_input_stats : bool,
                                  momentum : float,
                                  eps : float,
                                  cudnn_enabled : bool) -> Tensor

torch.nn.functional.kl_div(self : Tensor,
                           target : Tensor,
                           reduction : int=1) -> Tensor

torch.nn.functional.l1_loss(self : Tensor,
                            target : Tensor,
                            reduction : int=1,
                            out : Tensor) -> Tensor

torch.nn.functional.l1_loss(self : Tensor,
                            target : Tensor,
                            reduction : int=1) -> Tensor

torch.nn.functional.layer_norm(input : Tensor,
                               normalized_shape : List[int],
                               weight : Optional[Tensor],
                               bias : Optional[Tensor],
                               eps : float=1e-05,
                               cudnn_enable : bool=True) -> Tensor

torch.nn.functional.leaky_relu_(self : Tensor,
                                negative_slope : Scalar=0.01) -> Tensor

torch.nn.functional.linear(input : Tensor,
                           weight : Tensor,
                           bias : Tensor) -> Tensor

torch.nn.functional.log_softmax(self : Tensor,
                                dim : int) -> Tensor

torch.nn.functional.log_softmax(self : Tensor,
                                dim : int,
                                dtype : int) -> Tensor

torch.nn.functional.logsigmoid(self : Tensor) -> Tensor

torch.nn.functional.logsigmoid(self : Tensor,
                               out : Tensor) -> Tensor

torch.nn.functional.margin_ranking_loss(input1 : Tensor,
                                        input2 : Tensor,
                                        target : Tensor,
                                        margin : float=0.0,
                                        reduction : int=1) -> Tensor

torch.nn.functional.max_pool1d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0],
                               dilation : List[int]=[1],
                               ceil_mode : bool=False) -> Tensor

torch.nn.functional.max_pool2d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0],
                               dilation : List[int]=[1],
                               ceil_mode : bool=False) -> Tensor

torch.nn.functional.max_pool3d(self : Tensor,
                               kernel_size : List[int],
                               stride : List[int]=[],
                               padding : List[int]=[0],
                               dilation : List[int]=[1],
                               ceil_mode : bool=False) -> Tensor

torch.nn.functional.max_unpool2d(self : Tensor,
                                 indices : Tensor,
                                 output_size : List[int]) -> Tensor

torch.nn.functional.max_unpool2d(self : Tensor,
                                 indices : Tensor,
                                 output_size : List[int],
                                 out : Tensor) -> Tensor

torch.nn.functional.max_unpool3d(self : Tensor,
                                 indices : Tensor,
                                 output_size : List[int],
                                 stride : List[int],
                                 padding : List[int],
                                 out : Tensor) -> Tensor

torch.nn.functional.max_unpool3d(self : Tensor,
                                 indices : Tensor,
                                 output_size : List[int],
                                 stride : List[int],
                                 padding : List[int]) -> Tensor

torch.nn.functional.mse_loss(self : Tensor,
                             target : Tensor,
                             reduction : int=1,
                             out : Tensor) -> Tensor

torch.nn.functional.mse_loss(self : Tensor,
                             target : Tensor,
                             reduction : int=1) -> Tensor

torch.nn.functional.mul(self : Tensor,
                        other : Tensor) -> Tensor

torch.nn.functional.mul(self : Tensor,
                        other : Scalar) -> Tensor

torch.nn.functional.mul(self : Tensor,
                        other : Tensor,
                        out : Tensor) -> Tensor

torch.nn.functional.mul(a : int,
                        b : int) -> int

torch.nn.functional.mul(a : float,
                        b : float) -> float

torch.nn.functional.mul(a : int,
                        b : float) -> float

torch.nn.functional.mul(a : float,
                        b : int) -> float

torch.nn.functional.multi_margin_loss(self : Tensor,
                                      target : Tensor,
                                      p : Scalar=1,
                                      margin : Scalar=1,
                                      weight : Tensor,
                                      reduction : int=1,
                                      out : Tensor) -> Tensor

torch.nn.functional.multi_margin_loss(self : Tensor,
                                      target : Tensor,
                                      p : Scalar=1,
                                      margin : Scalar=1,
                                      weight : Tensor,
                                      reduction : int=1) -> Tensor

torch.nn.functional.multilabel_margin_loss(self : Tensor,
                                           target : Tensor,
                                           reduction : int=1) -> Tensor

torch.nn.functional.multilabel_margin_loss(self : Tensor,
                                           target : Tensor,
                                           reduction : int=1,
                                           out : Tensor) -> Tensor

torch.nn.functional.nll_loss(self : Tensor,
                             target : Tensor,
                             weight : Tensor,
                             reduction : int=1,
                             ignore_index : int=-100) -> Tensor

torch.nn.functional.nll_loss(self : Tensor,
                             target : Tensor,
                             weight : Tensor,
                             reduction : int=1,
                             ignore_index : int=-100,
                             out : Tensor) -> Tensor

torch.nn.functional.pdist(self : Tensor,
                          p : float=2.0) -> Tensor

torch.nn.functional.pixel_shuffle(self : Tensor,
                                  upscale_factor : int) -> Tensor

torch.nn.functional.relu_(self : Tensor) -> Tensor

torch.nn.functional.rrelu_(self : Tensor,
                           lower : Scalar=0.125,
                           upper : Scalar=0.3333333333333333,
                           training : bool=False,
                           generator : Generator) -> Tensor

torch.nn.functional.selu_(self : Tensor) -> Tensor

torch.nn.functional.smooth_l1_loss(self : Tensor,
                                   target : Tensor,
                                   reduction : int=1) -> Tensor

torch.nn.functional.smooth_l1_loss(self : Tensor,
                                   target : Tensor,
                                   reduction : int=1,
                                   out : Tensor) -> Tensor

torch.nn.functional.soft_margin_loss(self : Tensor,
                                     target : Tensor,
                                     reduction : int=1,
                                     out : Tensor) -> Tensor

torch.nn.functional.soft_margin_loss(self : Tensor,
                                     target : Tensor,
                                     reduction : int=1) -> Tensor

torch.nn.functional.softplus(self : Tensor,
                             beta : Scalar=1,
                             threshold : Scalar=20,
                             out : Tensor) -> Tensor

torch.nn.functional.softplus(self : Tensor,
                             beta : Scalar=1,
                             threshold : Scalar=20) -> Tensor

torch.nn.functional.softshrink(self : Tensor,
                               lambd : Scalar=0.5) -> Tensor

torch.nn.functional.softshrink(self : Tensor,
                               lambd : Scalar=0.5,
                               out : Tensor) -> Tensor

torch.nn.functional.threshold_(self : Tensor,
                               threshold : Scalar,
                               value : Scalar) -> Tensor

torch.nn.functional.triplet_margin_loss(anchor : Tensor,
                                        positive : Tensor,
                                        negative : Tensor,
                                        margin : float=1.0,
                                        p : float=2.0,
                                        eps : float=1e-06,
                                        swap : bool=False,
                                        reduction : int=1) -> Tensor

torch.nn.functional.unfold(self : Tensor,
                           dimension : int,
                           size : int,
                           step : int) -> Tensor

torch._C._nn.adaptive_avg_pool2d(self : Tensor,
                                 output_size : List[int],
                                 out : Tensor) -> Tensor

torch._C._nn.adaptive_avg_pool2d(self : Tensor,
                                 output_size : List[int]) -> Tensor

torch._C._nn.adaptive_avg_pool3d(self : Tensor,
                                 output_size : List[int]) -> Tensor

torch._C._nn.adaptive_avg_pool3d(self : Tensor,
                                 output_size : List[int],
                                 out : Tensor) -> Tensor

torch._C._nn.adaptive_max_pool2d(self : Tensor,
                                 output_size : List[int]) -> Tuple[Tensor, Tensor]

torch._C._nn.adaptive_max_pool3d(self : Tensor,
                                 output_size : List[int]) -> Tuple[Tensor, Tensor]

torch._C._nn.avg_pool2d(self : Tensor,
                        kernel_size : List[int],
                        stride : List[int]=[],
                        padding : List[int]=[0, 0],
                        ceil_mode : bool=False,
                        count_include_pad : bool=True) -> Tensor

torch._C._nn.avg_pool2d(self : Tensor,
                        kernel_size : List[int],
                        stride : List[int]=[],
                        padding : List[int]=[0, 0],
                        ceil_mode : bool=False,
                        count_include_pad : bool=True,
                        out : Tensor) -> Tensor

torch._C._nn.avg_pool3d(self : Tensor,
                        kernel_size : List[int],
                        stride : List[int]=[],
                        padding : List[int]=[0, 0, 0],
                        ceil_mode : bool=False,
                        count_include_pad : bool=True) -> Tensor

torch._C._nn.avg_pool3d(self : Tensor,
                        kernel_size : List[int],
                        stride : List[int]=[],
                        padding : List[int]=[0, 0, 0],
                        ceil_mode : bool=False,
                        count_include_pad : bool=True,
                        out : Tensor) -> Tensor

torch._C._nn.binary_cross_entropy(self : Tensor,
                                  target : Tensor,
                                  weight : Tensor,
                                  reduction : int=1,
                                  out : Tensor) -> Tensor

torch._C._nn.binary_cross_entropy(self : Tensor,
                                  target : Tensor,
                                  weight : Tensor,
                                  reduction : int=1) -> Tensor

torch._C._nn.elu(self : Tensor,
                 alpha : Scalar=1,
                 scale : Scalar=1,
                 input_scale : Scalar=1,
                 out : Tensor) -> Tensor

torch._C._nn.elu(self : Tensor,
                 alpha : Scalar=1,
                 scale : Scalar=1,
                 input_scale : Scalar=1) -> Tensor

torch._C._nn.elu_(self : Tensor,
                  alpha : Scalar=1,
                  scale : Scalar=1,
                  input_scale : Scalar=1) -> Tensor

torch._C._nn.elu_forward_(self : Tensor,
                          alpha : Scalar,
                          scale : Scalar,
                          input_scale : Scalar) -> Tensor

torch._C._nn.fractional_max_pool2d(self : Tensor,
                                   kernel_size : List[int],
                                   output_size : List[int],
                                   random_samples : Tensor) -> Tuple[Tensor, Tensor]

torch._C._nn.glu(self : Tensor,
                 dim : int=-1) -> Tensor

torch._C._nn.glu(self : Tensor,
                 dim : int=-1,
                 out : Tensor) -> Tensor

torch._C._nn.hardtanh(self : Tensor,
                      min_val : Scalar=-1,
                      max_val : Scalar=1,
                      out : Tensor) -> Tensor

torch._C._nn.hardtanh(self : Tensor,
                      min_val : Scalar=-1,
                      max_val : Scalar=1) -> Tensor

torch._C._nn.hardtanh_(self : Tensor,
                       min_val : Scalar=-1,
                       max_val : Scalar=1) -> Tensor

torch._C._nn.hardtanh_forward_(self : Tensor,
                               min_val : Scalar,
                               max_val : Scalar) -> Tensor

torch._C._nn.l1_loss(self : Tensor,
                     target : Tensor,
                     reduction : int=1,
                     out : Tensor) -> Tensor

torch._C._nn.l1_loss(self : Tensor,
                     target : Tensor,
                     reduction : int=1) -> Tensor

torch._C._nn.leaky_relu(self : Tensor,
                        negative_slope : Scalar=0.01) -> Tensor

torch._C._nn.leaky_relu(self : Tensor,
                        negative_slope : Scalar=0.01,
                        out : Tensor) -> Tensor

torch._C._nn.leaky_relu_(self : Tensor,
                         negative_slope : Scalar=0.01) -> Tensor

torch._C._nn.leaky_relu_forward_(self : Tensor,
                                 negative_slope : Scalar) -> Tensor

torch._C._nn.log_sigmoid(self : Tensor) -> Tensor

torch._C._nn.log_sigmoid(self : Tensor,
                         out : Tensor) -> Tensor

torch._C._nn.max_pool2d_with_indices(self : Tensor,
                                     kernel_size : List[int],
                                     stride : List[int]=[],
                                     padding : List[int]=[0, 0],
                                     dilation : List[int]=[1, 1],
                                     ceil_mode : bool=False) -> Tuple[Tensor, Tensor]

torch._C._nn.max_pool3d_with_indices(self : Tensor,
                                     kernel_size : List[int],
                                     stride : List[int]=[],
                                     padding : List[int]=[0, 0, 0],
                                     dilation : List[int]=[1, 1, 1],
                                     ceil_mode : bool=False) -> Tuple[Tensor, Tensor]

torch._C._nn.max_unpool2d(self : Tensor,
                          indices : Tensor,
                          output_size : List[int]) -> Tensor

torch._C._nn.max_unpool2d(self : Tensor,
                          indices : Tensor,
                          output_size : List[int],
                          out : Tensor) -> Tensor

torch._C._nn.max_unpool3d(self : Tensor,
                          indices : Tensor,
                          output_size : List[int],
                          stride : List[int],
                          padding : List[int],
                          out : Tensor) -> Tensor

torch._C._nn.max_unpool3d(self : Tensor,
                          indices : Tensor,
                          output_size : List[int],
                          stride : List[int],
                          padding : List[int]) -> Tensor

torch._C._nn.mse_loss(self : Tensor,
                      target : Tensor,
                      reduction : int=1,
                      out : Tensor) -> Tensor

torch._C._nn.mse_loss(self : Tensor,
                      target : Tensor,
                      reduction : int=1) -> Tensor

torch._C._nn.multi_margin_loss(self : Tensor,
                               target : Tensor,
                               p : Scalar=1,
                               margin : Scalar=1,
                               weight : Tensor,
                               reduction : int=1,
                               out : Tensor) -> Tensor

torch._C._nn.multi_margin_loss(self : Tensor,
                               target : Tensor,
                               p : Scalar=1,
                               margin : Scalar=1,
                               weight : Tensor,
                               reduction : int=1) -> Tensor

torch._C._nn.multilabel_margin_loss(self : Tensor,
                                    target : Tensor,
                                    reduction : int=1) -> Tensor

torch._C._nn.multilabel_margin_loss(self : Tensor,
                                    target : Tensor,
                                    reduction : int=1,
                                    out : Tensor) -> Tensor

torch._C._nn.nll_loss(self : Tensor,
                      target : Tensor,
                      weight : Tensor,
                      reduction : int=1,
                      ignore_index : int=-100) -> Tensor

torch._C._nn.nll_loss(self : Tensor,
                      target : Tensor,
                      weight : Tensor,
                      reduction : int=1,
                      ignore_index : int=-100,
                      out : Tensor) -> Tensor

torch._C._nn.nll_loss2d(self : Tensor,
                        target : Tensor,
                        weight : Tensor,
                        reduction : int=1,
                        ignore_index : int=-100) -> Tensor

torch._C._nn.nll_loss2d(self : Tensor,
                        target : Tensor,
                        weight : Tensor,
                        reduction : int=1,
                        ignore_index : int=-100,
                        out : Tensor) -> Tensor

torch._C._nn.reflection_pad1d(self : Tensor,
                              padding : List[int]) -> Tensor

torch._C._nn.reflection_pad1d(self : Tensor,
                              padding : List[int],
                              out : Tensor) -> Tensor

torch._C._nn.reflection_pad2d(self : Tensor,
                              padding : List[int]) -> Tensor

torch._C._nn.reflection_pad2d(self : Tensor,
                              padding : List[int],
                              out : Tensor) -> Tensor

torch._C._nn.replication_pad1d(self : Tensor,
                               padding : List[int]) -> Tensor

torch._C._nn.replication_pad1d(self : Tensor,
                               padding : List[int],
                               out : Tensor) -> Tensor

torch._C._nn.replication_pad2d(self : Tensor,
                               padding : List[int]) -> Tensor

torch._C._nn.replication_pad2d(self : Tensor,
                               padding : List[int],
                               out : Tensor) -> Tensor

torch._C._nn.replication_pad3d(self : Tensor,
                               padding : List[int],
                               out : Tensor) -> Tensor

torch._C._nn.replication_pad3d(self : Tensor,
                               padding : List[int]) -> Tensor

torch._C._nn.rrelu_with_noise(self : Tensor,
                              noise : Tensor,
                              lower : Scalar=0.125,
                              upper : Scalar=0.3333333333333333,
                              training : bool=False,
                              generator : Generator,
                              out : Tensor) -> Tensor

torch._C._nn.rrelu_with_noise(self : Tensor,
                              noise : Tensor,
                              lower : Scalar=0.125,
                              upper : Scalar=0.3333333333333333,
                              training : bool=False,
                              generator : Generator) -> Tensor

torch._C._nn.rrelu_with_noise_(self : Tensor,
                               noise : Tensor,
                               lower : Scalar=0.125,
                               upper : Scalar=0.3333333333333333,
                               training : bool=False,
                               generator : Generator) -> Tensor

torch._C._nn.smooth_l1_loss(self : Tensor,
                            target : Tensor,
                            reduction : int=1) -> Tensor

torch._C._nn.smooth_l1_loss(self : Tensor,
                            target : Tensor,
                            reduction : int=1,
                            out : Tensor) -> Tensor

torch._C._nn.soft_margin_loss(self : Tensor,
                              target : Tensor,
                              reduction : int=1,
                              out : Tensor) -> Tensor

torch._C._nn.soft_margin_loss(self : Tensor,
                              target : Tensor,
                              reduction : int=1) -> Tensor

torch._C._nn.softplus(self : Tensor,
                      beta : Scalar=1,
                      threshold : Scalar=20,
                      out : Tensor) -> Tensor

torch._C._nn.softplus(self : Tensor,
                      beta : Scalar=1,
                      threshold : Scalar=20) -> Tensor

torch._C._nn.softshrink(self : Tensor,
                        lambd : Scalar=0.5) -> Tensor

torch._C._nn.softshrink(self : Tensor,
                        lambd : Scalar=0.5,
                        out : Tensor) -> Tensor

torch._C._nn.thnn_conv2d(self : Tensor,
                         weight : Tensor,
                         kernel_size : List[int],
                         bias : Tensor,
                         stride : List[int]=[1, 1],
                         padding : List[int]=[0, 0]) -> Tensor

torch._C._nn.thnn_conv2d(self : Tensor,
                         weight : Tensor,
                         kernel_size : List[int],
                         bias : Tensor,
                         stride : List[int]=[1, 1],
                         padding : List[int]=[0, 0],
                         out : Tensor) -> Tensor

torch._C._nn.thnn_conv3d(self : Tensor,
                         weight : Tensor,
                         kernel_size : List[int],
                         bias : Tensor,
                         stride : List[int]=[1, 1, 1],
                         padding : List[int]=[0, 0, 0],
                         out : Tensor) -> Tensor

torch._C._nn.thnn_conv3d(self : Tensor,
                         weight : Tensor,
                         kernel_size : List[int],
                         bias : Tensor,
                         stride : List[int]=[1, 1, 1],
                         padding : List[int]=[0, 0, 0]) -> Tensor

torch._C._nn.thnn_conv_depthwise2d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1],
                                   padding : List[int]=[0, 0],
                                   dilation : List[int]=[1, 1]) -> Tensor

torch._C._nn.thnn_conv_depthwise2d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1],
                                   padding : List[int]=[0, 0],
                                   dilation : List[int]=[1, 1],
                                   out : Tensor) -> Tensor

torch._C._nn.thnn_conv_dilated2d(self : Tensor,
                                 weight : Tensor,
                                 kernel_size : List[int],
                                 bias : Tensor,
                                 stride : List[int]=[1, 1],
                                 padding : List[int]=[0, 0],
                                 dilation : List[int]=[1, 1]) -> Tensor

torch._C._nn.thnn_conv_dilated2d(self : Tensor,
                                 weight : Tensor,
                                 kernel_size : List[int],
                                 bias : Tensor,
                                 stride : List[int]=[1, 1],
                                 padding : List[int]=[0, 0],
                                 dilation : List[int]=[1, 1],
                                 out : Tensor) -> Tensor

torch._C._nn.thnn_conv_dilated3d(self : Tensor,
                                 weight : Tensor,
                                 kernel_size : List[int],
                                 bias : Tensor,
                                 stride : List[int]=[1, 1, 1],
                                 padding : List[int]=[0, 0, 0],
                                 dilation : List[int]=[1, 1, 1],
                                 out : Tensor) -> Tensor

torch._C._nn.thnn_conv_dilated3d(self : Tensor,
                                 weight : Tensor,
                                 kernel_size : List[int],
                                 bias : Tensor,
                                 stride : List[int]=[1, 1, 1],
                                 padding : List[int]=[0, 0, 0],
                                 dilation : List[int]=[1, 1, 1]) -> Tensor

torch._C._nn.thnn_conv_transpose2d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1],
                                   padding : List[int]=[0, 0],
                                   output_padding : List[int]=[0, 0],
                                   dilation : List[int]=[1, 1]) -> Tensor

torch._C._nn.thnn_conv_transpose2d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1],
                                   padding : List[int]=[0, 0],
                                   output_padding : List[int]=[0, 0],
                                   dilation : List[int]=[1, 1],
                                   out : Tensor) -> Tensor

torch._C._nn.thnn_conv_transpose3d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1, 1],
                                   padding : List[int]=[0, 0, 0],
                                   output_padding : List[int]=[0, 0, 0],
                                   dilation : List[int]=[1, 1, 1],
                                   out : Tensor) -> Tensor

torch._C._nn.thnn_conv_transpose3d(self : Tensor,
                                   weight : Tensor,
                                   kernel_size : List[int],
                                   bias : Tensor,
                                   stride : List[int]=[1, 1, 1],
                                   padding : List[int]=[0, 0, 0],
                                   output_padding : List[int]=[0, 0, 0],
                                   dilation : List[int]=[1, 1, 1]) -> Tensor

torch._C._nn.upsample_bilinear2d(self : Tensor,
                                 output_size : List[int],
                                 align_corners : bool) -> Tensor

torch._C._nn.upsample_bilinear2d(self : Tensor,
                                 output_size : List[int],
                                 align_corners : bool,
                                 out : Tensor) -> Tensor

torch._C._nn.upsample_linear1d(self : Tensor,
                               output_size : List[int],
                               align_corners : bool) -> Tensor

torch._C._nn.upsample_linear1d(self : Tensor,
                               output_size : List[int],
                               align_corners : bool,
                               out : Tensor) -> Tensor

torch._C._nn.upsample_nearest1d(self : Tensor,
                                output_size : List[int]) -> Tensor

torch._C._nn.upsample_nearest1d(self : Tensor,
                                output_size : List[int],
                                out : Tensor) -> Tensor

torch._C._nn.upsample_nearest2d(self : Tensor,
                                output_size : List[int]) -> Tensor

torch._C._nn.upsample_nearest2d(self : Tensor,
                                output_size : List[int],
                                out : Tensor) -> Tensor

torch._C._nn.upsample_nearest3d(self : Tensor,
                                output_size : List[int],
                                out : Tensor) -> Tensor

torch._C._nn.upsample_nearest3d(self : Tensor,
                                output_size : List[int]) -> Tensor

torch._C._nn.upsample_trilinear3d(self : Tensor,
                                  output_size : List[int],
                                  align_corners : bool,
                                  out : Tensor) -> Tensor

torch._C._nn.upsample_trilinear3d(self : Tensor,
                                  output_size : List[int],
                                  align_corners : bool) -> Tensor

Supported Methods

Tensor.__and__(other : Tensor) -> Tensor

Tensor.__and__(other : Scalar) -> Tensor

Tensor.__iand__(other : Tensor) -> Tensor

Tensor.__iand__(other : Scalar) -> Tensor

Tensor.__ilshift__(other : Tensor) -> Tensor

Tensor.__ilshift__(other : Scalar) -> Tensor

Tensor.__ior__(other : Tensor) -> Tensor

Tensor.__ior__(other : Scalar) -> Tensor

Tensor.__irshift__(other : Tensor) -> Tensor

Tensor.__irshift__(other : Scalar) -> Tensor

Tensor.__ixor__(other : Tensor) -> Tensor

Tensor.__ixor__(other : Scalar) -> Tensor

Tensor.__lshift__(other : Tensor) -> Tensor

Tensor.__lshift__(other : Scalar) -> Tensor

Tensor.__or__(other : Tensor) -> Tensor

Tensor.__or__(other : Scalar) -> Tensor

Tensor.__rshift__(other : Tensor) -> Tensor

Tensor.__rshift__(other : Scalar) -> Tensor

Tensor.__xor__(other : Tensor) -> Tensor

Tensor.__xor__(other : Scalar) -> Tensor

Tensor.abs() -> Tensor

Tensor.abs(out : Tensor) -> Tensor

Tensor.abs_() -> Tensor

Tensor.acos(out : Tensor) -> Tensor

Tensor.acos() -> Tensor

Tensor.acos_() -> Tensor

Tensor.add(other : Tensor,
           alpha : Scalar=1) -> Tensor

Tensor.add(other : Scalar,
           alpha : Scalar=1) -> Tensor

Tensor.add(other : Tensor,
           alpha : Scalar=1,
           out : Tensor) -> Tensor

Tensor.add_(other : Tensor,
            alpha : Scalar=1) -> Tensor

Tensor.add_(other : Scalar,
            alpha : Scalar=1) -> Tensor

Tensor.addbmm(batch1 : Tensor,
              batch2 : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1) -> Tensor

Tensor.addbmm(batch1 : Tensor,
              batch2 : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1,
              out : Tensor) -> Tensor

Tensor.addbmm_(batch1 : Tensor,
               batch2 : Tensor,
               beta : Scalar=1,
               alpha : Scalar=1) -> Tensor

Tensor.addcdiv(tensor1 : Tensor,
               tensor2 : Tensor,
               value : Scalar=1,
               out : Tensor) -> Tensor

Tensor.addcdiv(tensor1 : Tensor,
               tensor2 : Tensor,
               value : Scalar=1) -> Tensor

Tensor.addcdiv_(tensor1 : Tensor,
                tensor2 : Tensor,
                value : Scalar=1) -> Tensor

Tensor.addcmul(tensor1 : Tensor,
               tensor2 : Tensor,
               value : Scalar=1) -> Tensor

Tensor.addcmul(tensor1 : Tensor,
               tensor2 : Tensor,
               value : Scalar=1,
               out : Tensor) -> Tensor

Tensor.addcmul_(tensor1 : Tensor,
                tensor2 : Tensor,
                value : Scalar=1) -> Tensor

Tensor.addmm(mat1 : Tensor,
             mat2 : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1,
             out : Tensor) -> Tensor

Tensor.addmm(mat1 : Tensor,
             mat2 : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1) -> Tensor

Tensor.addmm_(mat1 : Tensor,
              mat2 : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1) -> Tensor

Tensor.addmv(mat : Tensor,
             vec : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1,
             out : Tensor) -> Tensor

Tensor.addmv(mat : Tensor,
             vec : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1) -> Tensor

Tensor.addmv_(mat : Tensor,
              vec : Tensor,
              beta : Scalar=1,
              alpha : Scalar=1) -> Tensor

Tensor.addr(vec1 : Tensor,
            vec2 : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1) -> Tensor

Tensor.addr(vec1 : Tensor,
            vec2 : Tensor,
            beta : Scalar=1,
            alpha : Scalar=1,
            out : Tensor) -> Tensor

Tensor.addr_(vec1 : Tensor,
             vec2 : Tensor,
             beta : Scalar=1,
             alpha : Scalar=1) -> Tensor

Tensor.all() -> Tensor

Tensor.all(dim : int,
           keepdim : bool=False) -> Tensor

Tensor.all(dim : int,
           keepdim : bool=False,
           out : Tensor) -> Tensor

Tensor.allclose(other : Tensor,
                rtol : float=1e-05,
                atol : float=1e-08,
                equal_nan : bool=False) -> bool

Tensor.any() -> Tensor

Tensor.any(dim : int,
           keepdim : bool=False) -> Tensor

Tensor.any(dim : int,
           keepdim : bool=False,
           out : Tensor) -> Tensor

Tensor.argmax() -> Tensor

Tensor.argmax(dim : int,
              keepdim : bool=False) -> Tensor

Tensor.argmin() -> Tensor

Tensor.argmin(dim : int,
              keepdim : bool=False) -> Tensor

Tensor.as_strided(size : List[int],
                  stride : List[int]) -> Tensor

Tensor.as_strided(size : List[int],
                  stride : List[int],
                  storage_offset : int) -> Tensor

Tensor.as_strided_(size : List[int],
                   stride : List[int]) -> Tensor

Tensor.as_strided_(size : List[int],
                   stride : List[int],
                   storage_offset : int) -> Tensor

Tensor.asin() -> Tensor

Tensor.asin(out : Tensor) -> Tensor

Tensor.asin_() -> Tensor

Tensor.atan() -> Tensor

Tensor.atan(out : Tensor) -> Tensor

Tensor.atan2(other : Tensor,
             out : Tensor) -> Tensor

Tensor.atan2(other : Tensor) -> Tensor

Tensor.atan2_(other : Tensor) -> Tensor

Tensor.atan_() -> Tensor

Tensor.baddbmm(batch1 : Tensor,
               batch2 : Tensor,
               beta : Scalar=1,
               alpha : Scalar=1) -> Tensor

Tensor.baddbmm(batch1 : Tensor,
               batch2 : Tensor,
               beta : Scalar=1,
               alpha : Scalar=1,
               out : Tensor) -> Tensor

Tensor.baddbmm_(batch1 : Tensor,
                batch2 : Tensor,
                beta : Scalar=1,
                alpha : Scalar=1) -> Tensor

Tensor.bernoulli(generator : Generator) -> Tensor

Tensor.bernoulli(p : float,
                 generator : Generator) -> Tensor

Tensor.bernoulli(generator : Generator,
                 out : Tensor) -> Tensor

Tensor.bernoulli_(p : Tensor,
                  generator : Generator) -> Tensor

Tensor.bernoulli_(p : float=0.5,
                  generator : Generator) -> Tensor

Tensor.bincount(weights : Optional[Tensor],
                minlength : int=0) -> Tensor

Tensor.bmm(mat2 : Tensor) -> Tensor

Tensor.bmm(mat2 : Tensor,
           out : Tensor) -> Tensor

Tensor.btrifact(pivot : bool=True) -> Tuple[Tensor, Tensor]

Tensor.btrifact_with_info(pivot : bool=True) -> Tuple[Tensor, Tensor, Tensor]

Tensor.btrisolve(LU_data : Tensor,
                 LU_pivots : Tensor,
                 out : Tensor) -> Tensor

Tensor.btrisolve(LU_data : Tensor,
                 LU_pivots : Tensor) -> Tensor

Tensor.cauchy_(median : float=0.0,
               sigma : float=1.0,
               generator : Generator) -> Tensor

Tensor.ceil(out : Tensor) -> Tensor

Tensor.ceil() -> Tensor

Tensor.ceil_() -> Tensor

Tensor.cholesky(upper : bool=False,
                out : Tensor) -> Tensor

Tensor.cholesky(upper : bool=False) -> Tensor

Tensor.chunk(chunks : int,
             dim : int=0) -> List[Tensor]

Tensor.clamp(min : Optional[Scalar],
             max : Optional[Scalar]) -> Tensor

Tensor.clamp(min : Optional[Scalar],
             max : Optional[Scalar],
             out : Tensor) -> Tensor

Tensor.clamp_(min : Optional[Scalar],
              max : Optional[Scalar]) -> Tensor

Tensor.clamp_max(max : Scalar) -> Tensor

Tensor.clamp_max(max : Scalar,
                 out : Tensor) -> Tensor

Tensor.clamp_max_(max : Scalar) -> Tensor

Tensor.clamp_min(min : Scalar,
                 out : Tensor) -> Tensor

Tensor.clamp_min(min : Scalar) -> Tensor

Tensor.clamp_min_(min : Scalar) -> Tensor

Tensor.clone() -> Tensor

Tensor.coalesce() -> Tensor

Tensor.contiguous() -> Tensor

Tensor.cos() -> Tensor

Tensor.cos(out : Tensor) -> Tensor

Tensor.cos_() -> Tensor

Tensor.cosh() -> Tensor

Tensor.cosh(out : Tensor) -> Tensor

Tensor.cosh_() -> Tensor

Tensor.cross(other : Tensor,
             dim : int=-1,
             out : Tensor) -> Tensor

Tensor.cross(other : Tensor,
             dim : int=-1) -> Tensor

Tensor.cumprod(dim : int) -> Tensor

Tensor.cumprod(dim : int,
               dtype : int) -> Tensor

Tensor.cumprod(dim : int,
               out : Tensor) -> Tensor

Tensor.cumprod(dim : int,
               dtype : int,
               out : Tensor) -> Tensor

Tensor.cumsum(dim : int) -> Tensor

Tensor.cumsum(dim : int,
              dtype : int) -> Tensor

Tensor.cumsum(dim : int,
              out : Tensor) -> Tensor

Tensor.cumsum(dim : int,
              dtype : int,
              out : Tensor) -> Tensor

Tensor.dense_dim() -> int

Tensor.det() -> Tensor

Tensor.detach() -> Tensor

Tensor.detach_() -> Tensor

Tensor.diag(diagonal : int=0) -> Tensor

Tensor.diag(diagonal : int=0,
            out : Tensor) -> Tensor

Tensor.diag_embed(offset : int=0,
                  dim1 : int=-2,
                  dim2 : int=-1) -> Tensor

Tensor.diagflat(offset : int=0) -> Tensor

Tensor.diagonal(offset : int=0,
                dim1 : int=0,
                dim2 : int=1) -> Tensor

Tensor.digamma() -> Tensor

Tensor.digamma(out : Tensor) -> Tensor

Tensor.digamma_() -> Tensor

Tensor.dim() -> int

Tensor.dist(other : Tensor,
            p : Scalar=2) -> Tensor

Tensor.div(other : Tensor,
           out : Tensor) -> Tensor

Tensor.div(other : Tensor) -> Tensor

Tensor.div(other : Scalar) -> Tensor

Tensor.div_(other : Tensor) -> Tensor

Tensor.div_(other : Scalar) -> Tensor

Tensor.dot(tensor : Tensor) -> Tensor

Tensor.dot(tensor : Tensor,
           out : Tensor) -> Tensor

Tensor.eig(eigenvectors : bool=False) -> Tuple[Tensor, Tensor]

Tensor.eq(other : Tensor) -> Tensor

Tensor.eq(other : Scalar) -> Tensor

Tensor.eq(other : Tensor,
          out : Tensor) -> Tensor

Tensor.eq(other : Scalar,
          out : Tensor) -> Tensor

Tensor.eq_(other : Tensor) -> Tensor

Tensor.eq_(other : Scalar) -> Tensor

Tensor.equal(other : Tensor) -> bool

Tensor.erf(out : Tensor) -> Tensor

Tensor.erf() -> Tensor

Tensor.erf_() -> Tensor

Tensor.erfc(out : Tensor) -> Tensor

Tensor.erfc() -> Tensor

Tensor.erfc_() -> Tensor

Tensor.erfinv(out : Tensor) -> Tensor

Tensor.erfinv() -> Tensor

Tensor.erfinv_() -> Tensor

Tensor.exp() -> Tensor

Tensor.exp(out : Tensor) -> Tensor

Tensor.exp_() -> Tensor

Tensor.expand(size : List[int],
              implicit : bool=False) -> Tensor

Tensor.expand_as(other : Tensor) -> Tensor

Tensor.expm1(out : Tensor) -> Tensor

Tensor.expm1() -> Tensor

Tensor.expm1_() -> Tensor

Tensor.exponential_(lambd : float=1.0,
                    generator : Generator) -> Tensor

Tensor.fft(signal_ndim : int,
           normalized : bool=False) -> Tensor

Tensor.fill_(value : Tensor) -> Tensor

Tensor.fill_(value : Scalar) -> Tensor

Tensor.flatten(start_dim : int=0,
               end_dim : int=-1) -> Tensor

Tensor.flip(dims : List[int]) -> Tensor

Tensor.floor() -> Tensor

Tensor.floor(out : Tensor) -> Tensor

Tensor.floor_() -> Tensor

Tensor.fmod(other : Tensor,
            out : Tensor) -> Tensor

Tensor.fmod(other : Scalar,
            out : Tensor) -> Tensor

Tensor.fmod(other : Tensor) -> Tensor

Tensor.fmod(other : Scalar) -> Tensor

Tensor.fmod_(other : Tensor) -> Tensor

Tensor.fmod_(other : Scalar) -> Tensor

Tensor.frac() -> Tensor

Tensor.frac(out : Tensor) -> Tensor

Tensor.frac_() -> Tensor

Tensor.gather(dim : int,
              index : Tensor,
              out : Tensor) -> Tensor

Tensor.gather(dim : int,
              index : Tensor) -> Tensor

Tensor.ge(other : Tensor) -> Tensor

Tensor.ge(other : Scalar) -> Tensor

Tensor.ge(other : Tensor,
          out : Tensor) -> Tensor

Tensor.ge(other : Scalar,
          out : Tensor) -> Tensor

Tensor.ge_(other : Tensor) -> Tensor

Tensor.ge_(other : Scalar) -> Tensor

Tensor.gels(A : Tensor) -> Tuple[Tensor, Tensor]

Tensor.geometric_(p : float,
                  generator : Generator) -> Tensor

Tensor.geqrf() -> Tuple[Tensor, Tensor]

Tensor.ger(vec2 : Tensor) -> Tensor

Tensor.ger(vec2 : Tensor,
           out : Tensor) -> Tensor

Tensor.gesv(A : Tensor) -> Tuple[Tensor, Tensor]

Tensor.get_device() -> int

Tensor.get_device() -> int

Tensor.get_device() -> int

Tensor.gt(other : Tensor) -> Tensor

Tensor.gt(other : Scalar) -> Tensor

Tensor.gt(other : Tensor,
          out : Tensor) -> Tensor

Tensor.gt(other : Scalar,
          out : Tensor) -> Tensor

Tensor.gt_(other : Tensor) -> Tensor

Tensor.gt_(other : Scalar) -> Tensor

Tensor.hardshrink(lambd : Scalar=0.5) -> Tensor

Tensor.histc(bins : int=100,
             min : Scalar=0,
             max : Scalar=0,
             out : Tensor) -> Tensor

Tensor.histc(bins : int=100,
             min : Scalar=0,
             max : Scalar=0) -> Tensor

Tensor.ifft(signal_ndim : int,
            normalized : bool=False) -> Tensor

Tensor.index_add_(dim : int,
                  index : Tensor,
                  source : Tensor) -> Tensor

Tensor.index_copy_(dim : int,
                   index : Tensor,
                   source : Tensor) -> Tensor

Tensor.index_fill_(dim : int,
                   index : Tensor,
                   value : Tensor) -> Tensor

Tensor.index_fill_(dim : int,
                   index : Tensor,
                   value : Scalar) -> Tensor

Tensor.index_put(indices : List[Tensor],
                 values : Tensor) -> Tensor

Tensor.index_put_(indices : List[Tensor],
                  values : Tensor) -> Tensor

Tensor.index_select(dim : int,
                    index : Tensor,
                    out : Tensor) -> Tensor

Tensor.index_select(dim : int,
                    index : Tensor) -> Tensor

Tensor.indices() -> Tensor

Tensor.inverse(out : Tensor) -> Tensor

Tensor.inverse() -> Tensor

Tensor.irfft(signal_ndim : int,
             normalized : bool=False,
             onesided : bool=True,
             signal_sizes : List[int]=[]) -> Tensor

Tensor.is_coalesced() -> bool

Tensor.is_complex() -> bool

Tensor.is_distributed() -> bool

Tensor.is_floating_point() -> bool

Tensor.is_nonzero() -> bool

Tensor.is_same_size(other : Tensor) -> bool

Tensor.is_set_to(tensor : Tensor) -> bool

Tensor.is_signed() -> bool

Tensor.isclose(other : Tensor,
               rtol : float=1e-05,
               atol : float=1e-08,
               equal_nan : bool=False) -> Tensor

Tensor.kthvalue(k : int,
                dim : int=-1,
                keepdim : bool=False) -> Tuple[Tensor, Tensor]

Tensor.le(other : Tensor,
          out : Tensor) -> Tensor

Tensor.le(other : Scalar,
          out : Tensor) -> Tensor

Tensor.le(other : Tensor) -> Tensor

Tensor.le(other : Scalar) -> Tensor

Tensor.le_(other : Tensor) -> Tensor

Tensor.le_(other : Scalar) -> Tensor

Tensor.lerp(end : Tensor,
            weight : Scalar) -> Tensor

Tensor.lerp(end : Tensor,
            weight : Scalar,
            out : Tensor) -> Tensor

Tensor.lerp_(end : Tensor,
             weight : Scalar) -> Tensor

Tensor.lgamma(out : Tensor) -> Tensor

Tensor.lgamma() -> Tensor

Tensor.lgamma_() -> Tensor

Tensor.log() -> Tensor

Tensor.log(out : Tensor) -> Tensor

Tensor.log10(out : Tensor) -> Tensor

Tensor.log10() -> Tensor

Tensor.log10_() -> Tensor

Tensor.log1p() -> Tensor

Tensor.log1p(out : Tensor) -> Tensor

Tensor.log1p_() -> Tensor

Tensor.log2() -> Tensor

Tensor.log2(out : Tensor) -> Tensor

Tensor.log2_() -> Tensor

Tensor.log_() -> Tensor

Tensor.log_normal_(mean : float=1.0,
                   std : float=2.0,
                   generator : Generator) -> Tensor

Tensor.log_softmax(dim : int) -> Tensor

Tensor.log_softmax(dim : int,
                   dtype : int) -> Tensor

Tensor.logdet() -> Tensor

Tensor.logsumexp(dim : int,
                 keepdim : bool=False) -> Tensor

Tensor.logsumexp(dim : int,
                 keepdim : bool=False,
                 out : Tensor) -> Tensor

Tensor.lt(other : Tensor,
          out : Tensor) -> Tensor

Tensor.lt(other : Scalar,
          out : Tensor) -> Tensor

Tensor.lt(other : Tensor) -> Tensor

Tensor.lt(other : Scalar) -> Tensor

Tensor.lt_(other : Tensor) -> Tensor

Tensor.lt_(other : Scalar) -> Tensor

Tensor.masked_fill_(mask : Tensor,
                    value : Tensor) -> Tensor

Tensor.masked_fill_(mask : Tensor,
                    value : Scalar) -> Tensor

Tensor.masked_scatter_(mask : Tensor,
                       source : Tensor) -> Tensor

Tensor.masked_select(mask : Tensor,
                     out : Tensor) -> Tensor

Tensor.masked_select(mask : Tensor) -> Tensor

Tensor.matmul(other : Tensor,
              out : Tensor) -> Tensor

Tensor.matmul(other : Tensor) -> Tensor

Tensor.matrix_power(n : int) -> Tensor

Tensor.max(other : Tensor,
           out : Tensor) -> Tensor

Tensor.max() -> Tensor

Tensor.max(other : Tensor) -> Tensor

Tensor.max(dim : int,
           keepdim : bool=False) -> Tuple[Tensor, Tensor]

Tensor.mean() -> Tensor

Tensor.mean(dtype : int) -> Tensor

Tensor.mean(dim : int,
            keepdim : bool=False) -> Tensor

Tensor.mean(dim : int,
            dtype : int) -> Tensor

Tensor.mean(dim : int,
            keepdim : bool,
            dtype : int) -> Tensor

Tensor.mean(dim : int,
            keepdim : bool=False,
            out : Tensor) -> Tensor

Tensor.mean(dim : int,
            dtype : int,
            out : Tensor) -> Tensor

Tensor.mean(dim : int,
            keepdim : bool,
            dtype : int,
            out : Tensor) -> Tensor

Tensor.median() -> Tensor

Tensor.median(dim : int,
              keepdim : bool=False) -> Tuple[Tensor, Tensor]

Tensor.min() -> Tensor

Tensor.min(other : Tensor) -> Tensor

Tensor.min(dim : int,
           keepdim : bool=False) -> Tuple[Tensor, Tensor]

Tensor.min(other : Tensor,
           out : Tensor) -> Tensor

Tensor.mm(mat2 : Tensor,
          out : Tensor) -> Tensor

Tensor.mm(mat2 : Tensor) -> Tensor

Tensor.mode(dim : int=-1,
            keepdim : bool=False) -> Tuple[Tensor, Tensor]

Tensor.mul(other : Tensor) -> Tensor

Tensor.mul(other : Scalar) -> Tensor

Tensor.mul(other : Tensor,
           out : Tensor) -> Tensor

Tensor.mul_(other : Tensor) -> Tensor

Tensor.mul_(other : Scalar) -> Tensor

Tensor.multinomial(num_samples : int,
                   replacement : bool=False,
                   generator : Generator) -> Tensor

Tensor.multinomial(num_samples : int,
                   replacement : bool=False,
                   generator : Generator,
                   out : Tensor) -> Tensor

Tensor.mv(vec : Tensor,
          out : Tensor) -> Tensor

Tensor.mv(vec : Tensor) -> Tensor

Tensor.mvlgamma(p : int) -> Tensor

Tensor.mvlgamma_(p : int) -> Tensor

Tensor.narrow(dim : int,
              start : int,
              length : int) -> Tensor

Tensor.narrow_copy(dim : int,
                   start : int,
                   length : int) -> Tensor

Tensor.ne(other : Tensor) -> Tensor

Tensor.ne(other : Scalar) -> Tensor

Tensor.ne(other : Tensor,
          out : Tensor) -> Tensor

Tensor.ne(other : Scalar,
          out : Tensor) -> Tensor

Tensor.ne_(other : Tensor) -> Tensor

Tensor.ne_(other : Scalar) -> Tensor

Tensor.neg(out : Tensor) -> Tensor

Tensor.neg() -> Tensor

Tensor.neg_() -> Tensor

Tensor.nonzero(out : Tensor) -> Tensor

Tensor.nonzero() -> Tensor

Tensor.norm(p : Scalar=2) -> Tensor

Tensor.norm(p : Scalar,
            dim : int,
            keepdim : bool=False) -> Tensor

Tensor.norm(p : Scalar,
            dim : int,
            keepdim : bool=False,
            out : Tensor) -> Tensor

Tensor.normal_(mean : float=0.0,
               std : float=1.0,
               generator : Generator) -> Tensor

Tensor.numel() -> int

Tensor.orgqr(input2 : Tensor) -> Tensor

Tensor.orgqr(input2 : Tensor,
             out : Tensor) -> Tensor

Tensor.ormqr(input2 : Tensor,
             input3 : Tensor,
             left : bool=True,
             transpose : bool=False) -> Tensor

Tensor.ormqr(input2 : Tensor,
             input3 : Tensor,
             left : bool=True,
             transpose : bool=False,
             out : Tensor) -> Tensor

Tensor.permute(dims : List[int]) -> Tensor

Tensor.pin_memory() -> Tensor

Tensor.pinverse(rcond : float=1e-15) -> Tensor

Tensor.polygamma_(n : int) -> Tensor

Tensor.potri(upper : bool=True) -> Tensor

Tensor.potri(upper : bool=True,
             out : Tensor) -> Tensor

Tensor.potrs(input2 : Tensor,
             upper : bool=True) -> Tensor

Tensor.potrs(input2 : Tensor,
             upper : bool=True,
             out : Tensor) -> Tensor

Tensor.pow(exponent : Tensor) -> Tensor

Tensor.pow(exponent : Scalar) -> Tensor

Tensor.pow(exponent : Tensor,
           out : Tensor) -> Tensor

Tensor.pow(exponent : Scalar,
           out : Tensor) -> Tensor

Tensor.pow_(exponent : Tensor) -> Tensor

Tensor.pow_(exponent : Scalar) -> Tensor

Tensor.prelu(weight : Tensor) -> Tensor

Tensor.prod(dim : int,
            keepdim : bool=False,
            out : Tensor) -> Tensor

Tensor.prod(dim : int,
            dtype : int,
            out : Tensor) -> Tensor

Tensor.prod(dim : int,
            keepdim : bool,
            dtype : int,
            out : Tensor) -> Tensor

Tensor.prod() -> Tensor

Tensor.prod(dtype : int) -> Tensor

Tensor.prod(dim : int,
            keepdim : bool=False) -> Tensor

Tensor.prod(dim : int,
            dtype : int) -> Tensor

Tensor.prod(dim : int,
            keepdim : bool,
            dtype : int) -> Tensor

Tensor.pstrf(upper : bool=True,
             tol : Scalar=-1) -> Tuple[Tensor, Tensor]

Tensor.put_(index : Tensor,
            source : Tensor,
            accumulate : bool=False) -> Tensor

Tensor.qr() -> Tuple[Tensor, Tensor]

Tensor.random_(generator : Generator) -> Tensor

Tensor.random_(to : int,
               generator : Generator) -> Tensor

Tensor.random_(from : int,
               to : int,
               generator : Generator) -> Tensor

Tensor.reciprocal() -> Tensor

Tensor.reciprocal(out : Tensor) -> Tensor

Tensor.reciprocal_() -> Tensor

Tensor.relu() -> Tensor

Tensor.relu_() -> Tensor

Tensor.remainder(other : Tensor) -> Tensor

Tensor.remainder(other : Scalar) -> Tensor

Tensor.remainder(other : Tensor,
                 out : Tensor) -> Tensor

Tensor.remainder(other : Scalar,
                 out : Tensor) -> Tensor

Tensor.remainder_(other : Tensor) -> Tensor

Tensor.remainder_(other : Scalar) -> Tensor

Tensor.renorm(p : Scalar,
              dim : int,
              maxnorm : Scalar,
              out : Tensor) -> Tensor

Tensor.renorm(p : Scalar,
              dim : int,
              maxnorm : Scalar) -> Tensor

Tensor.renorm_(p : Scalar,
               dim : int,
               maxnorm : Scalar) -> Tensor

Tensor.repeat(repeats : List[int]) -> Tensor

Tensor.reshape(shape : List[int]) -> Tensor

Tensor.reshape_as(other : Tensor) -> Tensor

Tensor.resize_(size : List[int]) -> Tensor

Tensor.resize_as_(the_template : Tensor) -> Tensor

Tensor.rfft(signal_ndim : int,
            normalized : bool=False,
            onesided : bool=True) -> Tensor

Tensor.roll(shifts : List[int],
            dims : List[int]=[]) -> Tensor

Tensor.rot90(k : int=1,
             dims : List[int]=[0, 1]) -> Tensor

Tensor.round() -> Tensor

Tensor.round(out : Tensor) -> Tensor

Tensor.round_() -> Tensor

Tensor.rsqrt(out : Tensor) -> Tensor

Tensor.rsqrt() -> Tensor

Tensor.rsqrt_() -> Tensor

Tensor.scatter_(dim : int,
                index : Tensor,
                src : Tensor) -> Tensor

Tensor.scatter_(dim : int,
                index : Tensor,
                value : Scalar) -> Tensor

Tensor.scatter_add_(dim : int,
                    index : Tensor,
                    src : Tensor) -> Tensor

Tensor.select(dim : int,
              index : int) -> Tensor

Tensor.set_() -> Tensor

Tensor.set_(source : Tensor) -> Tensor

Tensor.sigmoid() -> Tensor

Tensor.sigmoid(out : Tensor) -> Tensor

Tensor.sigmoid_() -> Tensor

Tensor.sign() -> Tensor

Tensor.sign(out : Tensor) -> Tensor

Tensor.sign_() -> Tensor

Tensor.sin() -> Tensor

Tensor.sin(out : Tensor) -> Tensor

Tensor.sin_() -> Tensor

Tensor.sinh(out : Tensor) -> Tensor

Tensor.sinh() -> Tensor

Tensor.sinh_() -> Tensor

Tensor.size(dim : int) -> int

Tensor.size() -> List[int]

Tensor.slogdet() -> Tuple[Tensor, Tensor]

Tensor.smm(mat2 : Tensor) -> Tensor

Tensor.softmax(dim : int) -> Tensor

Tensor.softmax(dim : int,
               dtype : int) -> Tensor

Tensor.sort(dim : int=-1,
            descending : bool=False) -> Tuple[Tensor, Tensor]

Tensor.sparse_dim() -> int

Tensor.sparse_resize_(size : List[int],
                      sparse_dim : int,
                      dense_dim : int) -> Tensor

Tensor.sparse_resize_and_clear_(size : List[int],
                                sparse_dim : int,
                                dense_dim : int) -> Tensor

Tensor.split(split_size : int,
             dim : int=0) -> List[Tensor]

Tensor.split(split_sizes : List[int],
             dim : int=0) -> List[Tensor]

Tensor.split_with_sizes(split_sizes : List[int],
                        dim : int=0) -> List[Tensor]

Tensor.sqrt(out : Tensor) -> Tensor

Tensor.sqrt() -> Tensor

Tensor.sqrt_() -> Tensor

Tensor.squeeze() -> Tensor

Tensor.squeeze(dim : int) -> Tensor

Tensor.squeeze_() -> Tensor

Tensor.squeeze_(dim : int) -> Tensor

Tensor.sspaddmm(mat1 : Tensor,
                mat2 : Tensor,
                beta : Scalar=1,
                alpha : Scalar=1,
                out : Tensor) -> Tensor

Tensor.sspaddmm(mat1 : Tensor,
                mat2 : Tensor,
                beta : Scalar=1,
                alpha : Scalar=1) -> Tensor

Tensor.std(unbiased : bool=True) -> Tensor

Tensor.std(dim : int,
           unbiased : bool=True,
           keepdim : bool=False) -> Tensor

Tensor.std(dim : int,
           unbiased : bool=True,
           keepdim : bool=False,
           out : Tensor) -> Tensor

Tensor.stft(n_fft : int,
            hop_length : int,
            win_length : int,
            window : Optional[Tensor],
            normalized : bool=False,
            onesided : bool=True) -> Tensor

Tensor.storage_offset() -> int

Tensor.storage_offset() -> int

Tensor.storage_offset() -> int

Tensor.stride(dim : int) -> int

Tensor.sub(other : Tensor,
           alpha : Scalar=1) -> Tensor

Tensor.sub(other : Scalar,
           alpha : Scalar=1) -> Tensor

Tensor.sub(other : Tensor,
           alpha : Scalar=1,
           out : Tensor) -> Tensor

Tensor.sub_(other : Tensor,
            alpha : Scalar=1) -> Tensor

Tensor.sub_(other : Scalar,
            alpha : Scalar=1) -> Tensor

Tensor.sum(dim : List[int],
           keepdim : bool=False,
           out : Tensor) -> Tensor

Tensor.sum(dim : List[int],
           dtype : int,
           out : Tensor) -> Tensor

Tensor.sum(dim : List[int],
           keepdim : bool,
           dtype : int,
           out : Tensor) -> Tensor

Tensor.sum() -> Tensor

Tensor.sum(dtype : int) -> Tensor

Tensor.sum(dim : List[int],
           keepdim : bool=False) -> Tensor

Tensor.sum(dim : List[int],
           dtype : int) -> Tensor

Tensor.sum(dim : List[int],
           keepdim : bool,
           dtype : int) -> Tensor

Tensor.svd(some : bool=True,
           compute_uv : bool=True) -> Tuple[Tensor, Tensor, Tensor]

Tensor.symeig(eigenvectors : bool=False,
              upper : bool=True) -> Tuple[Tensor, Tensor]

Tensor.t() -> Tensor

Tensor.t_() -> Tensor

Tensor.take(index : Tensor) -> Tensor

Tensor.take(index : Tensor,
            out : Tensor) -> Tensor

Tensor.tan(out : Tensor) -> Tensor

Tensor.tan() -> Tensor

Tensor.tan_() -> Tensor

Tensor.tanh() -> Tensor

Tensor.tanh(out : Tensor) -> Tensor

Tensor.tanh_() -> Tensor

Tensor.to(other : Tensor,
          non_blocking : bool=False,
          copy : bool=False) -> Tensor

Tensor.to(dtype : int,
          non_blocking : bool=False,
          copy : bool=False) -> Tensor

Tensor.to(device : List[int],
          dtype : int,
          non_blocking : bool=False,
          copy : bool=False) -> Tensor

Tensor.to(dtype : int=6,
          layout : int=0,
          device : List[int]=[0, -1],
          non_blocking : bool=False,
          copy : bool=False) -> Tensor

Tensor.to_dense() -> Tensor

Tensor.to_sparse() -> Tensor

Tensor.to_sparse(sparse_dim : int) -> Tensor

Tensor.topk(k : int,
            dim : int=-1,
            largest : bool=True,
            sorted : bool=True) -> Tuple[Tensor, Tensor]

Tensor.trace() -> Tensor

Tensor.transpose(dim0 : int,
                 dim1 : int) -> Tensor

Tensor.transpose_(dim0 : int,
                  dim1 : int) -> Tensor

Tensor.tril(diagonal : int=0,
            out : Tensor) -> Tensor

Tensor.tril(diagonal : int=0) -> Tensor

Tensor.tril_(diagonal : int=0) -> Tensor

Tensor.triu(diagonal : int=0,
            out : Tensor) -> Tensor

Tensor.triu(diagonal : int=0) -> Tensor

Tensor.triu_(diagonal : int=0) -> Tensor

Tensor.trtrs(A : Tensor,
             upper : bool=True,
             transpose : bool=False,
             unitriangular : bool=False) -> Tuple[Tensor, Tensor]

Tensor.trunc() -> Tensor

Tensor.trunc(out : Tensor) -> Tensor

Tensor.trunc_() -> Tensor

Tensor.type_as(other : Tensor) -> Tensor

Tensor.unbind(dim : int=0) -> List[Tensor]

Tensor.unfold(dimension : int,
              size : int,
              step : int) -> Tensor

Tensor.uniform_(from : float=0.0,
                to : float=1.0,
                generator : Generator) -> Tensor

Tensor.unsqueeze(dim : int) -> Tensor

Tensor.unsqueeze_(dim : int) -> Tensor

Tensor.values() -> Tensor

Tensor.var(dim : int,
           unbiased : bool=True,
           keepdim : bool=False,
           out : Tensor) -> Tensor

Tensor.var(unbiased : bool=True) -> Tensor

Tensor.var(dim : int,
           unbiased : bool=True,
           keepdim : bool=False) -> Tensor

Tensor.view(size : List[int]) -> Tensor

Tensor.view_as(other : Tensor) -> Tensor

Tensor.zero_() -> Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources