Installation

ptens is installed as a PyTorch C++ (or CUDA) extension and requires the following:

  1. C++17 or higher

  2. PyTorch

  3. cnine (see below)

ptens is easiest to install with pip:

  1. Download the cnine library

  2. Download ptens from github. By default, it is assumed that cnine and ptens are downloaded to the same directory (e.g., Downloads).

  3. Edit the user configurable variables in python/setup.py as necessary.

  4. Run the command pip install -e . in the ptens/python directory.

To use ptens from Python, load the module the usual way with import ptens.

Configuration

The ptens installation can be configured by setting the corresponding variables in python/setup.py.

compile_with_cuda

If set to True, ptens will be compiled with GPU suport. This requires a working CUDA and CUBLAS installation and PyTorch itself having been compiled with CUDA enabled.