Convert Tensors, Arrays and DataFrames Between CPU and CUDA
Project description
Convert Tensors, Arrays and DataFrames Between CPU and CUDA
📖 Documentation: https://abracudabra.docs.cern.ch/master
Abracudabra simplifies moving data between CPU and CUDA devices, supporting seamless conversions for Torch tensors, NumPy/CuPy arrays, and Pandas/cuDF Series and DataFrames.
Quick Installation
pip install abracudabra
Basic Usage
Here's a quick example demonstrating how to convert a NumPy array to a CUDA-compatible (CuPy) array:
from abracudabra import to_array
import torch
tensor = torch.rand(2, 3, device="cuda:0")
array = to_array(tensor)
print(type(array)) # <class 'cupy.ndarray'>
More Information
Abracudabra also supports conversions for dataframes, series, tensors, and includes utilities for querying and managing device contexts. For comprehensive documentation and additional examples, please visit the official usage guide.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 abracudabra-0.1.3-py3-none-any.whl.
File metadata
- Download URL: abracudabra-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d33364696c74904394bf00704de72fb021d145d5d9edb66533b2c8796ab728b4
|
|
| MD5 |
9567609ef8207684ff4cb9f67d089dbc
|
|
| BLAKE2b-256 |
56c069b49b852023b0d79271b7f7299dc620bdf9dbd8ddfec6f9d32f3cac2352
|