Installation
- Python
3.8
,3.9
,3.10
, or3.11
is required.
Pip
Poetry
Pipx
TensorShare modules
TensorShare is a modular library. It means that you can install only the modules you need to reduce the installation time and the number of dependencies.
Note
We do care about your CI/CD pipelines. That's why we provide a way to install only the necessary modules.
Only safetensors
and pydantic
are mandatory.
Client module
The client module is used to create a TensorShareClient
for sending tensors to a
FastAPI server.
Note
It installs aiohttp
on top of the main dependencies.
Server module
The server module is used to integrate TensorShare with a FastAPI server.
Note
It installs fastapi
on top of the main dependencies.
Check the TensorShareServer and the FastAPI integration sections for more details.
Backend Installation
TensorShare is a framework-agnostic library. It means that the default installation does not include any framework and assumes that you will handle the backend (or backends) yourself.
Note
All the backends are optional and can be installed separately, but they all require numpy
.
That's why they all come with numpy
as a dependency.
However, we provide a set of backends that can be installed alongside TensorShare.
- Jax |
flax>=0.6.3
,jax>=0.3.25
,jaxlib>=0.3.25
- NumPy |
numpy>=1.21.6
- PaddlePaddle |
paddlepaddle>=2.4.1
- Tensorflow |
tensorflow>=2.14
- PyTorch |
torch>=1.10
You can also install all the backends at once:
Contributing
We use Hatch as the package manager for development.
For installing the default environment:
The quality
and tests
environments are also available.
They will be auto-activated when running the corresponding commands.
# Linting and formatting using black and ruff
hatch run quality:format
# Typechecking using mypy
hatch run quality:typecheck
# Testing using pytest
hatch run tests:run
But you can also create them manually:
Created: 2023-08-20