Autocast PyTorch tensors to numpy/matplotlib-CPU arrays in matplotlib.
Project description
matplotlib-torch
Transparently pass PyTorch tensors (CPU, CUDA, MPS, with/without grad) to
matplotlib. Avoid .detach().cpu().numpy() boilerplate.
import matplotlib_torch
matplotlib_torch.activate()
import matplotlib.pyplot as plt
import torch
plt.plot(torch.tensor([1., 2., 3.], device='cuda')) # just works
Install
pip install matplotlib-torch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matplotlib_torch-0.1.0.tar.gz.
File metadata
- Download URL: matplotlib_torch-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cde4e4eb6f9e2feda440b96683a783d7a47182504d1a2f14c4def5365d79974
|
|
| MD5 |
c9976f9036c83cd2d4b69d77cacb1240
|
|
| BLAKE2b-256 |
2b0005270ec7f8ac72ed56add0998abb6da27df4791a0033eb84049b80e8b16f
|
File details
Details for the file matplotlib_torch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: matplotlib_torch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
600fb7f6fee92f7075508992e466ae9a0799a3a7c84927c74fb53dd2ba07442d
|
|
| MD5 |
59ea062d4ba0bac23171249b0983e77c
|
|
| BLAKE2b-256 |
2dc1cb53811621cf706748bcbd0937831716744ce61aa9fca71eb3d2d60944d9
|