Module phi.torch

PyTorch integration.

Importing this module registers the PyTorch backend with phiml.math. Without this, PyTorch tensors cannot be handled by phiml.math functions.

To make PyTorch the default backend, import phi.torch.flow.

Expand source code
"""
PyTorch integration.

Importing this module registers the PyTorch backend with `phiml.math`.
Without this, PyTorch tensors cannot be handled by `phiml.math` functions.

To make PyTorch the default backend, import `phi.torch.flow`.
"""
from phiml.backend.torch import TORCH

__all__ = [key for key in globals().keys() if not key.startswith('_')]

Sub-modules

phi.torch.flow

Standard import for PyTorch mode …

phi.torch.nets

PyTorch implementation of the unified machine learning API. Equivalent functions also exist for the other frameworks …