Skip to main content

PyTorch extension package for Bessel functions with arbitrary real order and complex inputs

Project description

About

PyTorch extension package for Bessel functions with arbitrary real order and complex inputs

Install

Currently only supports Linux (with CUDA 12.4) or MacOS (Apple silicon, cpu only) with python >= 3.9, <= 3.12.

pip install torch-bessel

Example

import torch_bessel

real, imag = torch.randn(2, 5, device="cuda")
z = torch.complex(real.abs(), imag)  # correctness for inputs in the left-half complex plane is not gauranteed.
torch_bessel.ops.modified_bessel_k0(z)

Implemented functions

  • modified_bessel_k0: Same as torch.special.modified_bessel_k0, but also handles backpropagation and complex inputs on cpu and cuda. Correctness is guaranteed on the right-half complex plane for double types, and almost guaranteed for float types, though it appears there are a very small handful of inputs which result in NaNs which needs to be fixed. On cuda, torch.chalf inputs are also supported, though the underlying cuda kernel just upcasts chalf to cfloat (note that this uses no extra GPU memory, as opposed to manually casting torch.chalf to torch.cfloat before calling modified_bessel_k0 which doubles the GPU memory used). On the left-half complex plane, function output appears mostly correct, but with small numerical errors for certain inputs. On the negative real line, output is NaN.

WIP

  • modified_bessel_kv: Analogue of scipy.special.kv.

Benchmarks

Benchmarking performed with the asv package. Results can be viewed at https://hchau630.github.io/torch-bessel.

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 Distributions

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

torch_bessel-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

torch_bessel-0.0.6-cp312-cp312-macosx_11_0_arm64.whl (81.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torch_bessel-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

torch_bessel-0.0.6-cp311-cp311-macosx_11_0_arm64.whl (82.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torch_bessel-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

torch_bessel-0.0.6-cp310-cp310-macosx_11_0_arm64.whl (80.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

torch_bessel-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

torch_bessel-0.0.6-cp39-cp39-macosx_11_0_arm64.whl (80.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file torch_bessel-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f12cf44ecc597ef1b7cae48e7d338236822bf46987c691dba5e1079ec90ccc05
MD5 c4d513ed28f861634989f3db561011e3
BLAKE2b-256 98ae41ae14e53d73c002a633f6b31edf923e7cecc649352fb2a3a2aba3c6c245

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b7c623fcae210b64bcfe1ea918c137ab3595ad627c131bdb041c50b05b883381
MD5 67426a24f35e08c464c02168c9e0bb12
BLAKE2b-256 264999cc4cfd555986e8a97aee0a3dc9348ee543c89686b79af0e065bacfad75

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b8c48f5cfc86a517fcbb5befc4a156bbb50fb908af4a228439c6e66c173f3b96
MD5 b4eed53ba87783c02b80c97c3884aef9
BLAKE2b-256 f81c04b41302934dfd8577575d47e2d5eb79221bf6d6d1eb968ec5bb8ce97d20

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01a1b5e65782eaeb022cc4222dc12d4130b31cacc1f2df547a66cc3bce785317
MD5 d270f132389bdc5c96d644d2f587678d
BLAKE2b-256 9d85b2c719efad4d9355e01345b7ae83f6dbccc0e0ac6b57f881ac9e6a34147d

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aec502e8b385419ecf43013d611594727141e8feed05ca6fae6fecec29b4893c
MD5 52f51e461f7e58704d7d346ea1989212
BLAKE2b-256 94d33b46d2a6026a5993167d35f4322a882c7b3ceed6f5e968ea6874e36f0074

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e3a23f2b8271302c30e7cf6af0f1d42dc4a2c70f60558f1a39f27c67a3f599c
MD5 505ab7b93b794662fd2c07fb855db10e
BLAKE2b-256 b180233447f8889129b82b860dfde3200709b89735eb8080abe796b30fe27f10

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1079bc95f8a7421afda8a25aa4c6e09f84e7c6280321671e727d25bf289a8df
MD5 9d66564336ebd73bc7bcc0ce706d99fd
BLAKE2b-256 03f40d598f3e4593033353f6c376fae17317f37af376c83e22c0128a95d83b04

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_bessel-0.0.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_bessel-0.0.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 edf8cefe3dee5790392c49fbc76da77bbbce14a8f7d48b91d9c45e1eaee3c225
MD5 d4b771c34661bcf9c347e108fe56749c
BLAKE2b-256 0627b8195efb34d6e247df384b2c4c6e5f0ad28bbc624de42d98ad9cbf157d3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_bessel-0.0.6-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: build_and_deploy.yml on hchau630/torch-bessel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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