tensi


Nametensi JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/DorsaRoh/tensi
SummaryInteractive tensor shape visualization library
upload_time2025-08-04 00:11:49
maintainerNone
docs_urlNone
authorDorsa Rohani
requires_python>=3.7
licenseNone
keywords tensor visualization pytorch numpy plotly deep-learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tensi

**Interactive tensor shape visualization**

Tensi turns multi‑dimensional tensors into intuitive, interactive geometry so you can instantly see what your data looks like.

*I built Tensi while wrangling distributed sharding‑and‑concatenation of latent tensors. Interactive geometric visuals of tensor shapes finally made the process make sense.*

## Installation

```bash
pip install tensi
```



## Quick Start

```python
import tensi
import torch

# Visualize a 3D tensor
tensor = torch.randn(2, 4, 5)  # [Batch, Rows, Cols]
fig = tensi.visualize(tensor)
fig.show()
```

## Usage Examples

### Basic Usage

```python
import tensi
import torch
import numpy as np

# Using the quick visualize function
tensor = torch.randn(3, 4, 5)
fig = tensi.visualize(tensor, title="My Tensor")
fig.show()

# Using different data types
data = [[1, 2, 3], [4, 5, 6]]
fig = tensi.visualize(data, dtype="int32")
fig.show()

# Using numpy arrays
np_array = np.random.rand(2, 3, 4)
fig = tensi.visualize(np_array, dtype="float64")
fig.show()
```



### Tensor Shapes

```python
# 2D Tensor
tensor_2d = torch.randn(5, 7)  # [Rows, Cols]
fig = tensi.visualize(tensor_2d, title="2D Tensor")
fig.show()

# 3D Tensor
tensor_3d = torch.randn(3, 5, 7)  # [Batch, Rows, Cols]
fig = tensi.visualize(tensor_3d, title="3D Tensor - 3 Batches")
fig.show()

# 4D Tensor
tensor_4d = torch.randn(2, 4, 5, 6)  # [Batch, Width, Height, Depth]
fig = tensi.visualize(tensor_4d, title="4D Tensor - 2 Batches")
fig.show()
```

### Save Visualizations

```python
# Save as interactive HTML
fig = tensi.visualize(tensor)
fig.write_html("tensor_visualization.html")

# Save as static image (requires kaleido)
fig.write_image("tensor_visualization.png")
```

## Requirements

- Python >= 3.7
- PyTorch >= 1.8.0
- NumPy >= 1.19.0
- Plotly >= 5.0.0


## Contributing

Contributions are welcome! Please feel free to submit a PR.

## Links

- [Github](https://github.com/DorsaRoh/tensi)
- [PyPI](https://pypi.org/project/tensi/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DorsaRoh/tensi",
    "name": "tensi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "tensor visualization pytorch numpy plotly deep-learning",
    "author": "Dorsa Rohani",
    "author_email": "dorsa.rohani@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/04/07/5eb09d52722f9fab356c804055ba57ea8b1ded170f1da48845ac58ce4a76/tensi-1.0.0.tar.gz",
    "platform": null,
    "description": "# Tensi\n\n**Interactive tensor shape visualization**\n\nTensi turns multi\u2011dimensional tensors into intuitive, interactive geometry so you can instantly see what your data looks like.\n\n*I built Tensi while wrangling distributed sharding\u2011and\u2011concatenation of latent tensors. Interactive geometric visuals of tensor shapes finally made the process make sense.*\n\n## Installation\n\n```bash\npip install tensi\n```\n\n\n\n## Quick Start\n\n```python\nimport tensi\nimport torch\n\n# Visualize a 3D tensor\ntensor = torch.randn(2, 4, 5)  # [Batch, Rows, Cols]\nfig = tensi.visualize(tensor)\nfig.show()\n```\n\n## Usage Examples\n\n### Basic Usage\n\n```python\nimport tensi\nimport torch\nimport numpy as np\n\n# Using the quick visualize function\ntensor = torch.randn(3, 4, 5)\nfig = tensi.visualize(tensor, title=\"My Tensor\")\nfig.show()\n\n# Using different data types\ndata = [[1, 2, 3], [4, 5, 6]]\nfig = tensi.visualize(data, dtype=\"int32\")\nfig.show()\n\n# Using numpy arrays\nnp_array = np.random.rand(2, 3, 4)\nfig = tensi.visualize(np_array, dtype=\"float64\")\nfig.show()\n```\n\n\n\n### Tensor Shapes\n\n```python\n# 2D Tensor\ntensor_2d = torch.randn(5, 7)  # [Rows, Cols]\nfig = tensi.visualize(tensor_2d, title=\"2D Tensor\")\nfig.show()\n\n# 3D Tensor\ntensor_3d = torch.randn(3, 5, 7)  # [Batch, Rows, Cols]\nfig = tensi.visualize(tensor_3d, title=\"3D Tensor - 3 Batches\")\nfig.show()\n\n# 4D Tensor\ntensor_4d = torch.randn(2, 4, 5, 6)  # [Batch, Width, Height, Depth]\nfig = tensi.visualize(tensor_4d, title=\"4D Tensor - 2 Batches\")\nfig.show()\n```\n\n### Save Visualizations\n\n```python\n# Save as interactive HTML\nfig = tensi.visualize(tensor)\nfig.write_html(\"tensor_visualization.html\")\n\n# Save as static image (requires kaleido)\nfig.write_image(\"tensor_visualization.png\")\n```\n\n## Requirements\n\n- Python >= 3.7\n- PyTorch >= 1.8.0\n- NumPy >= 1.19.0\n- Plotly >= 5.0.0\n\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a PR.\n\n## Links\n\n- [Github](https://github.com/DorsaRoh/tensi)\n- [PyPI](https://pypi.org/project/tensi/)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Interactive tensor shape visualization library",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/DorsaRoh/tensi"
    },
    "split_keywords": [
        "tensor",
        "visualization",
        "pytorch",
        "numpy",
        "plotly",
        "deep-learning"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1af9e781a12f21311bb8113b160c9a471e8f0d7edfbaad4bdd587d8954bdf3f1",
                "md5": "e86603e5ab489e5f394423ab8d245d82",
                "sha256": "292e1ae4c4d015657756c5bb3a67e5b702112475360ed2e8b301e1fb43a0922f"
            },
            "downloads": -1,
            "filename": "tensi-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e86603e5ab489e5f394423ab8d245d82",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6930,
            "upload_time": "2025-08-04T00:11:48",
            "upload_time_iso_8601": "2025-08-04T00:11:48.193025Z",
            "url": "https://files.pythonhosted.org/packages/1a/f9/e781a12f21311bb8113b160c9a471e8f0d7edfbaad4bdd587d8954bdf3f1/tensi-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "04075eb09d52722f9fab356c804055ba57ea8b1ded170f1da48845ac58ce4a76",
                "md5": "c7fbe69ea3df9743a337e69b69db5cec",
                "sha256": "009916d97cddf821cfdf73828e4a978c1fda365ccdefe0c6921ab435bfb6b075"
            },
            "downloads": -1,
            "filename": "tensi-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c7fbe69ea3df9743a337e69b69db5cec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7305,
            "upload_time": "2025-08-04T00:11:49",
            "upload_time_iso_8601": "2025-08-04T00:11:49.265223Z",
            "url": "https://files.pythonhosted.org/packages/04/07/5eb09d52722f9fab356c804055ba57ea8b1ded170f1da48845ac58ce4a76/tensi-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-04 00:11:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DorsaRoh",
    "github_project": "tensi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tensi"
}
        
Elapsed time: 1.77111s