You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2021. It is now read-only.
Tensor is a library and extension that provides objects for scientific computing in PHP. The multithreaded extension is especially suited for computing large sets of numbers. In some cases, the extension is 230X faster than the same operation in PHPland. Tensor is used by libraries such as Rubix ML to build and accelerate machine learning algorithms such as linear regression, dimensionality reduction, and neural networks.
Installation
Follow the instructions below to install either Tensor PHP or the Tensor extension.
Tensor PHP
Install Tensor PHP into your project with Composer:
Make sure you have all the necessary build tools installed such as a C compiler and make tools. For example, on an Ubuntu linux system you can enter the following on the command line to install the necessary dependencies.
Then, change into the ext directory from the project root and run the following commands from the terminal. See this guide for more information on compiling PHP extensions with PHPize.
$ cd ./ext
$ phpize
$ ./configure
$ make
$ sudo make install
Finally, add the following line to your php.ini configuration to install the extension.
extension=tensor.so
To confirm that the extension is loaded in PHP, you can run the following command.
php -m | grep tensor
Performance Comparison
Funding
Tensor is funded by donations from the community. You can become a sponsor by making a contribution to one of our funding sources below.