latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
Automatic differentiation package - tensorplay.autograd
Compute the sum of gradients of given tensors with respect to graph leaves. |
|
Compute and return the sum of gradients of outputs with respect to the inputs. |
Forward-mode Automatic Differentiation
Associates a tensor value with its tangent to create a "dual tensor". |
|
Unpacks a dual tensor into its primal value and forward gradient. |
|
Enters a new forward grad level and returns its index. |
|
Exits a forward grad level. |
Functional higher level API
Compute the Jacobian of a given function. |
|
Compute the Hessian of a given scalar function. |
|
Compute the dot product between a vector |
|
Compute the dot product between the Jacobian of the given function at the point given by the inputs and a vector |
|
Compute the dot product between vector |
|
Compute the dot product between the scalar function's Hessian and a vector |
Function
Records operation history and defines formulas for differentiating ops. |
|
Compute the dot product between the Jacobian of the given function at the point given by the inputs and a vector |
Context method mixins
the |
Custom Function utilities
Decorator to make a custom autograd Function's backward run once, with gradients detached and grad-mode disabled inside. |
|
In-place operations must call |
|
Kept only for import compatibility; the modern contract is to define |
Numerical gradient checking
Check gradients computed via small finite differences against analytical gradients wrt tensors in |
|
Check gradients of gradients computed via small finite differences against analytical gradients wrt tensors in |
|
Error raised by |
|
|
Profiler
Context manager that records dispatched operations and annotations. |
|
Mark a user-defined span in the active profiling session. |
|
A list of profiling events with helper methods for analysis and visualization. |
|
Helpers for FunctionEvent and FunctionEventAvg. |
|
Profiling information about a single function. |
|
Averaged profiling statistics over multiple FunctionEvent objects. |
|
Acceleration structure for accessing mem_records in interval. |
|
Emit named ranges for active operations. |
|
Emit instrumentation ranges for active operations. |
Debugging and anomaly detection
Context-manager that enables anomaly detection for the autograd engine. |
|
Context-manager that sets the anomaly detection for the autograd engine on or off. |
Autograd graph
Context manager that installs a (pack, unpack) pair for every tensor saved via |
|
Store saved values in host memory and restore their original device. |
|
Help improve this page
Found an error, an unclear step, or a missing example?
Serialization semantics
This note describes how you can save and load TensorPlay tensors and module states in Python, and how to serialize Python modules so they can be loaded in C++.
Automatic Mixed Precision package - tensorplay.amp
tensorplay.amp provides convenience methods for mixed precision, where some operations use the tensorplay.float32 ( float ) datatype and other operations use lower precision floating point datatype ( lower_precision_fp )

