1*da0073e9SAndroid Build Coastguard Worker# PyTorch Glossary 2*da0073e9SAndroid Build Coastguard Worker 3*da0073e9SAndroid Build Coastguard Worker<!-- toc --> 4*da0073e9SAndroid Build Coastguard Worker 5*da0073e9SAndroid Build Coastguard Worker- [Operation and Kernel](#operation-and-kernel) 6*da0073e9SAndroid Build Coastguard Worker - [ATen](#aten) 7*da0073e9SAndroid Build Coastguard Worker - [Operation](#operation) 8*da0073e9SAndroid Build Coastguard Worker - [Native Operation](#native-operation) 9*da0073e9SAndroid Build Coastguard Worker - [Custom Operation](#custom-operation) 10*da0073e9SAndroid Build Coastguard Worker - [Kernel](#kernel) 11*da0073e9SAndroid Build Coastguard Worker - [Compound Operation](#compound-operation) 12*da0073e9SAndroid Build Coastguard Worker - [Composite Operation](#composite-operation) 13*da0073e9SAndroid Build Coastguard Worker - [Non-Leaf Operation](#non-leaf-operation) 14*da0073e9SAndroid Build Coastguard Worker - [Leaf Operation](#leaf-operation) 15*da0073e9SAndroid Build Coastguard Worker - [Device Kernel](#device-kernel) 16*da0073e9SAndroid Build Coastguard Worker - [Compound Kernel](#compound-kernel) 17*da0073e9SAndroid Build Coastguard Worker- [JIT Compilation](#jit-compilation) 18*da0073e9SAndroid Build Coastguard Worker - [JIT](#jit) 19*da0073e9SAndroid Build Coastguard Worker - [TorchScript](#torchscript) 20*da0073e9SAndroid Build Coastguard Worker - [Tracing](#tracing) 21*da0073e9SAndroid Build Coastguard Worker - [Scripting](#scripting) 22*da0073e9SAndroid Build Coastguard Worker 23*da0073e9SAndroid Build Coastguard Worker<!-- tocstop --> 24*da0073e9SAndroid Build Coastguard Worker 25*da0073e9SAndroid Build Coastguard Worker# Operation and Kernel 26*da0073e9SAndroid Build Coastguard Worker 27*da0073e9SAndroid Build Coastguard Worker## ATen 28*da0073e9SAndroid Build Coastguard WorkerShort for "A Tensor Library". The foundational tensor and mathematical 29*da0073e9SAndroid Build Coastguard Workeroperation library on which all else is built. 30*da0073e9SAndroid Build Coastguard Worker 31*da0073e9SAndroid Build Coastguard Worker## Operation 32*da0073e9SAndroid Build Coastguard WorkerA unit of work. For example, the work of matrix multiplication is an operation 33*da0073e9SAndroid Build Coastguard Workercalled aten::matmul. 34*da0073e9SAndroid Build Coastguard Worker 35*da0073e9SAndroid Build Coastguard Worker## Native Operation 36*da0073e9SAndroid Build Coastguard WorkerAn operation that comes natively with PyTorch ATen, for example aten::matmul. 37*da0073e9SAndroid Build Coastguard Worker 38*da0073e9SAndroid Build Coastguard Worker## Custom Operation 39*da0073e9SAndroid Build Coastguard WorkerAn Operation that is defined by users and is usually a Compound Operation. 40*da0073e9SAndroid Build Coastguard WorkerFor example, this 41*da0073e9SAndroid Build Coastguard Worker[tutorial](https://pytorch.org/docs/stable/notes/extending.html) details how 42*da0073e9SAndroid Build Coastguard Workerto create Custom Operations. 43*da0073e9SAndroid Build Coastguard Worker 44*da0073e9SAndroid Build Coastguard Worker## Kernel 45*da0073e9SAndroid Build Coastguard WorkerImplementation of a PyTorch operation, specifying what should be done when an 46*da0073e9SAndroid Build Coastguard Workeroperation executes. 47*da0073e9SAndroid Build Coastguard Worker 48*da0073e9SAndroid Build Coastguard Worker## Compound Operation 49*da0073e9SAndroid Build Coastguard WorkerA Compound Operation is composed of other operations. Its kernel is usually 50*da0073e9SAndroid Build Coastguard Workerdevice-agnostic. Normally it doesn't have its own derivative functions defined. 51*da0073e9SAndroid Build Coastguard WorkerInstead, AutoGrad automatically computes its derivative based on operations it 52*da0073e9SAndroid Build Coastguard Workeruses. 53*da0073e9SAndroid Build Coastguard Worker 54*da0073e9SAndroid Build Coastguard Worker## Composite Operation 55*da0073e9SAndroid Build Coastguard WorkerSame as Compound Operation. 56*da0073e9SAndroid Build Coastguard Worker 57*da0073e9SAndroid Build Coastguard Worker## Non-Leaf Operation 58*da0073e9SAndroid Build Coastguard WorkerSame as Compound Operation. 59*da0073e9SAndroid Build Coastguard Worker 60*da0073e9SAndroid Build Coastguard Worker## Leaf Operation 61*da0073e9SAndroid Build Coastguard WorkerAn operation that's considered a basic operation, as opposed to a Compound 62*da0073e9SAndroid Build Coastguard WorkerOperation. Leaf Operation always has dispatch functions defined, usually has a 63*da0073e9SAndroid Build Coastguard Workerderivative function defined as well. 64*da0073e9SAndroid Build Coastguard Worker 65*da0073e9SAndroid Build Coastguard Worker## Device Kernel 66*da0073e9SAndroid Build Coastguard WorkerDevice-specific kernel of a leaf operation. 67*da0073e9SAndroid Build Coastguard Worker 68*da0073e9SAndroid Build Coastguard Worker## Compound Kernel 69*da0073e9SAndroid Build Coastguard WorkerOpposed to Device Kernels, Compound kernels are usually device-agnostic and belong to Compound Operations. 70*da0073e9SAndroid Build Coastguard Worker 71*da0073e9SAndroid Build Coastguard Worker# JIT Compilation 72*da0073e9SAndroid Build Coastguard Worker 73*da0073e9SAndroid Build Coastguard Worker## JIT 74*da0073e9SAndroid Build Coastguard WorkerJust-In-Time Compilation. 75*da0073e9SAndroid Build Coastguard Worker 76*da0073e9SAndroid Build Coastguard Worker## TorchScript 77*da0073e9SAndroid Build Coastguard WorkerAn interface to the TorchScript JIT compiler and interpreter. 78*da0073e9SAndroid Build Coastguard Worker 79*da0073e9SAndroid Build Coastguard Worker## Tracing 80*da0073e9SAndroid Build Coastguard WorkerUsing `torch.jit.trace` on a function to get an executable that can be optimized 81*da0073e9SAndroid Build Coastguard Workerusing just-in-time compilation. 82*da0073e9SAndroid Build Coastguard Worker 83*da0073e9SAndroid Build Coastguard Worker## Scripting 84*da0073e9SAndroid Build Coastguard WorkerUsing `torch.jit.script` on a function to inspect source code and compile it as 85*da0073e9SAndroid Build Coastguard WorkerTorchScript code. 86