Skip to main content

TensorShare

🤝 Trade any tensors over the network


TensorShare is a powerful tool enabling ⚡ lightning-fast tensor sharing across networks.

This project leverages the best open-source tools to provide a simple and easy-to-use interface for sharing tensors:

  • safetensors for secure tensor serialization and deserialization.
  • pydantic for data validation and settings management.
  • fastapi for building APIs (and because it's too good to avoid it).

This project is heavily in development and is not ready for production use. Feel free to contribute to the project by opening issues and pull requests.

Usage

Example of tensors serialization with torch:

import torch
from tensorshare import TensorShare

tensors = {
    "embeddings": torch.zeros((2, 2)),
    "labels": torch.zeros((2, 2)),
}
ts = TensorShare.from_dict(tensors, backend="torch")
print(ts)
# tensors=b'gAAAAAAAAAB7ImVtYmVkZGluZ3MiOnsiZHR5cGUiO...' size=168

You can now freely send the tensors over the network via any means (e.g. HTTP, gRPC, ...).

On the other side, when you receive the tensors, you can deserialize them in any supported backend:

from tensorshare import Backend

np_tensors = ts.to_tensors(backend=Backend.NUMPY)
print(np_tensors)
# {
# 	'embeddings': array([[0., 0.], [0., 0.]], dtype=float32),
# 	'labels': array([[0., 0.], [0., 0.]], dtype=float32)
# }

For more examples and details, please refer to the Usage section.

Roadmap

Metadata

Release files for tensorshare 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorshare 0.1.1
File Size Uploaded Provenance Actions
tensorshare-0.1.1.tar.gz 25.2 kB Without provenance Details for tensorshare-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tensorshare 0.1.1
File Interpreter ABI Platform Actions
tensorshare-0.1.1-py3-none-any.whl Python 3 none any Details for tensorshare-0.1.1-py3-none-any.whl

Total release size: 45.4 kB

Release files / tensorshare-0.1.1.tar.gz

Download URL tensorshare-0.1.1.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0b48c7ac81dbccfc0fc05a312e17de3abeb1302cbbad73b2afa7913c57d001bb
BLAKE2b-256 checksum
How to use checksums
59ae09bf8b042e2633d3e63a09475b73159b21e7f58466d93fc29a6e7903449c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release files / tensorshare-0.1.1-py3-none-any.whl

Download URL tensorshare-0.1.1-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74d14442b3f681068620187503267bf95f301cd281bfc44967d1c1d3c31addb3
BLAKE2b-256 checksum
How to use checksums
bd9272878af643353442a2cb3368b2310988ce60dd64b0eababaf54064296de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Security for tensorshare 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page