Skip to main content

No project description provided

Project description

ml_dtypes

Unittests Wheel Build PyPI version

This is not an officially supported Google product.

ml_dtypes is a stand-alone implementation of several NumPy dtype extensions used in machine learning libraries, including:

  • bfloat16: an alternative to the standard float16 format
  • float8_*: several experimental 8-bit floating point representations including:
    • float8_e4m3b11
    • float8_e4m3fn
    • float8_e5m2

Installation

The ml_dtypes package is tested with Python versions 3.9-3.11, and can be installed with the following command:

pip install ml_dtypes

To test your installation, you can run the following:

pip install absl-py pytest
pytest --pyargs ml_dtypes

To build from source, clone the repository and run:

git submodule init
git submodule update
pip install .

Example Usage

>>> from ml_dtypes import bfloat16
>>> import numpy as np
>>> np.zeros(4, dtype=bfloat16)
array([0, 0, 0, 0], dtype=bfloat16)

Importing ml_dtypes also registers the data types with numpy, so that they may be referred to by their string name:

>>> np.dtype('bfloat16')
dtype(bfloat16)
>>> np.dtype('float8_e5m2')
dtype(float8_e5m2)

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

ml_dtypes-0.0.2.tar.gz (682.9 kB view details)

Uploaded Source

Built Distributions

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

ml_dtypes-0.0.2-cp311-cp311-win_amd64.whl (135.2 kB view details)

Uploaded CPython 3.11Windows x86-64

ml_dtypes-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (230.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

ml_dtypes-0.0.2-cp311-cp311-macosx_10_9_universal2.whl (311.9 kB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

ml_dtypes-0.0.2-cp310-cp310-win_amd64.whl (135.3 kB view details)

Uploaded CPython 3.10Windows x86-64

ml_dtypes-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (230.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

ml_dtypes-0.0.2-cp310-cp310-macosx_10_9_universal2.whl (311.9 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

ml_dtypes-0.0.2-cp39-cp39-win_amd64.whl (135.3 kB view details)

Uploaded CPython 3.9Windows x86-64

ml_dtypes-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

ml_dtypes-0.0.2-cp39-cp39-macosx_10_9_universal2.whl (312.2 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

ml_dtypes-0.0.2-cp38-cp38-win_amd64.whl (134.7 kB view details)

Uploaded CPython 3.8Windows x86-64

ml_dtypes-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (230.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

ml_dtypes-0.0.2-cp38-cp38-macosx_10_9_universal2.whl (311.7 kB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)

File details

Details for the file ml_dtypes-0.0.2.tar.gz.

File metadata

  • Download URL: ml_dtypes-0.0.2.tar.gz
  • Upload date:
  • Size: 682.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ml_dtypes-0.0.2.tar.gz
Algorithm Hash digest
SHA256 14a0795ba84095dd012c2f7c387fdf813301c1e6be51e4c9b56809ee542f9520
MD5 2e51cafbce59c415a1a1e7e7935dceb1
BLAKE2b-256 f6d99b106fd8768c644fd0e54408fd2aab168a164cf6356817d5770589c47e06

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: ml_dtypes-0.0.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 135.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ml_dtypes-0.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7893db4a13023aec612fb5e81c20845e5f5c0e5be7200ce6a7025272fb4b4abd
MD5 0409903fb93d5be8fcc7e049006b3046
BLAKE2b-256 77b0f6f26b173e40dd283b79f0951fba9e265b1f73886baf381492ba6129868b

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e817ad95e8344258d0d63ea6f12e11966cfad980c6a5cd701a26e4fe1f3b2f43
MD5 f1e74c9b8bcff6f65152784797086696
BLAKE2b-256 396797953858927c542508d51225577d76c6ef46c3b00c672f83f7d0e99c9f0d

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 da479bd7ff83c5e446f7c04eef57fcf5cd5c6f3221259e9faf52fba4d7e6bb55
MD5 b3314301c40a85f197390b83844933a1
BLAKE2b-256 9f1f1c5a02fd968c33212981e26f348cdf17279f5803a44dc8e3bce4f9061f7f

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: ml_dtypes-0.0.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 135.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ml_dtypes-0.0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c1a757cd21022ab1731753fc4f0c2985cc7455713900fd7478b5398d5be75a95
MD5 fc7d675e63d48f3a7fef754b016eced5
BLAKE2b-256 381e67676a18734ce4f500b40e80e45b4a4eb967c0e8164b25f0e7d51afa1add

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4ee04c62001923c4ee488ca3469561e34fe587c7ab6bee35ffce1ab79f114d0
MD5 46d3bd27ccadc90987fab631e7a92142
BLAKE2b-256 c144c119c1b8fe2685b123e63074a87d22e5f959b65125f8580ac508687a419a

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7964d7bf373eb28072d0aa33c011e047c06d946ec275e82e1a1ad47deadb038b
MD5 99b977db6e3ba6afb48cbdc112eee15a
BLAKE2b-256 e3ec3d65b01b392263c6a7470586ca10026d5c2d7e7a1b0335e9c0361e7c5527

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ml_dtypes-0.0.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 135.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ml_dtypes-0.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 85cfff8caaaa6bb9f039e3826b7f77ad2d4420dc6940510449566270362fd448
MD5 d7bfdcc08ce87b9ca94e61ed1f1a4e3d
BLAKE2b-256 90958c565fa2c81ad7119716ba1435725797bc41c5b5a4fd259526ce51c9b6a3

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54f63f549172c21315ce21d17a633d7de1c06b4d96bb4ec944c2972ef5896c36
MD5 b63d243b60d3a58914c2734bc59194f9
BLAKE2b-256 8760bbbfd7ad4dfeed88a7404d5101b5379000f73cf0f6e48ac31f828f9a42f8

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 63d775489736c6a7d8dee0c48b8d724ca3ce4cbe3bb7d1192c2281ebbd879449
MD5 f09a49f1510f3a12ffa27e3ba9f88e6e
BLAKE2b-256 b1790b637adeef30ced27800520fdc30c43c868fcd3360b13127bb4ae564b6e1

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: ml_dtypes-0.0.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 134.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for ml_dtypes-0.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b167a2511c6a630a4a5f66b4780a3a1c526449f67e061aa6a78a551272c435b6
MD5 988800fa05453c54cfc07e333fb71027
BLAKE2b-256 0fbed87875c3009218e5f29766eff6017f978384d83771d8a586cc2a537bc7e8

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b98979a7084f392a5530d64bb46cc04ad2032b9ca68cccac1680f4b8805c274b
MD5 7d9d0f2e6392174431f4de40d000bd7f
BLAKE2b-256 f76cc401359e0137055fd03f3bd61b867aba08e22104dd728e4d762df20d28a1

See more details on using hashes here.

File details

Details for the file ml_dtypes-0.0.2-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ml_dtypes-0.0.2-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 935097a4a4ea1305dbee97d19ded0d82168afe11f6431b1f2e9bd1477528fcc1
MD5 102ced1aa372e8d5fcac28f033e8881f
BLAKE2b-256 3a26c78b302a69bf487dc3fe2ae188e14f04de752e9469d5ff3e12c1edc53b64

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