Skip to main content

Convert Tensors, Arrays and DataFrames Between CPU and CUDA

Project description

TurboGraph logo

Convert Tensors, Arrays and DataFrames Between CPU and CUDA

Pipeline Status Test Coverage License Latest Release PyPI - Version Python Version

📖 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

abracudabra-0.1.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file abracudabra-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for abracudabra-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32bd9f0ff680c90c1cb31b2be5d3a508ee1796b0e284880197beb1994a3eac8e
MD5 c952df171434ccfb5da79bb382b1b1c2
BLAKE2b-256 f0fbfc5d168af72f8941bb105dde1d138463eb150c9de0500f3c03adcc2b59ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page