Skip to main content

A package for converting floats to BFloat16 using optimized assembly.

Project description

bf16

BF16 is a Python package for converting floating-point numbers to BFloat16 format using optimized Windows x86-64 assembly.

Installation

pip install bf16

Usage

import bf16

x = bf16.bfloat16(3.14)
print(x)  # Outputs the BFloat16 approximation as a float and for the record it also actually output 3.12 because its a real breainfloat16
print(f"Size: {len(x.data)} bytes")  # Always 2 bytes

Requirements

  • Windows AMD x86-64
  • Python 3.6+ The package includes a compiled assembly executable for fast conversion.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bf16-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

bf16-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file bf16-1.0.0.tar.gz.

File metadata

  • Download URL: bf16-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bf16-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5e02106a769522d6f82e51ac98c394410c3d777e7e5d28c82de435de4757f262
MD5 4c52b032ee3027264aee3510929c315e
BLAKE2b-256 56d0d5fe4b8e411976f255988b9c03da91629ebd8cc04d5cf9d5e1d4ccf0359d

See more details on using hashes here.

File details

Details for the file bf16-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bf16-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bf16-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ed945430eba8b77568a23d0f4f9e05f9a0bf80ac356055451b305c12fd9e072
MD5 ba9faefffe480e84e4ef2a81e1a01407
BLAKE2b-256 cddf221ba0736e11980441a84153e802887fcda0f3eeed766431073ded848532

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