No project description provided
Project description
ml_dtypes
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 standardfloat16
formatfloat8_*
: 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.8-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)
License
The ml_dtypes
source code is licensed under the Apache 2.0 license
(see LICENSE). Pre-compiled wheels are built with the
EIGEN project, which is released under the
MPL 2.0 license (see LICENSE.eigen).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ml_dtypes-0.0.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d2e6c83c762aa6d476ea715ce6b2ac67f519c242cfe93d7a49cb76a83f6650 |
|
MD5 | c279a18965b081f298bb5933b2c32eb8 |
|
BLAKE2b-256 | 74c67ebcdbb9e6cb42dd6556bccae152d631b18413b659ff67de7d090e5ec60a |
Hashes for ml_dtypes-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ece1269b5311489e26b3f3181d498b8829042f380cd160d7fe02f2393f69a71 |
|
MD5 | 8d746d970cf31c3596747fe205846c9f |
|
BLAKE2b-256 | b48c6fff8a88b65af7f6a7c9d31c83812d60206654406f48581c2f28c7309d51 |
Hashes for ml_dtypes-0.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9912d50466d386a4016b16f889722183f6d6c03d9e478fdf62f41e50de0059 |
|
MD5 | de33a6b586d8b1e228173204e82b0ad3 |
|
BLAKE2b-256 | fbc7711d4b92e378bb2d08815923163b81f717c7448c824f7b22e8fefef143a6 |
Hashes for ml_dtypes-0.0.4-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52aaa9318e2a4ec65a6bc4842df3442a9cfa00a9b8365a08e0370b0dfefc3a5a |
|
MD5 | 0224db68404dafc9d686b895e51d6d82 |
|
BLAKE2b-256 | 9350df37fe19f85a8cfb276fedf21ff9b0a4efdff42ca8d2adc485af0654a73f |
Hashes for ml_dtypes-0.0.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f49901eb42cac259156edc17d4c1922ac47ddd1fe3c05169f445135a07319c |
|
MD5 | b082e623c0b474d701920dfda7b445f6 |
|
BLAKE2b-256 | c8647e82ca113d37b6596f7a46555909159421a0854ee8800fbbd7da39610158 |
Hashes for ml_dtypes-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a74c1fb29d2e586f643fb1a70b1dffe9fc35bc3ad8c76ec0797b2bf9f7ac128b |
|
MD5 | 05d2d7532297bc738a9b5c4ab8aefd16 |
|
BLAKE2b-256 | abc7436a36f20800c86f9cec8eaa769f54b98ba25a35d7765767741ad567c871 |
Hashes for ml_dtypes-0.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e600aa70a9f8ee85c9488eb14852124c878ec824c3c7996d2d82010655eabfe |
|
MD5 | cc2f39b49a502ab2cf7b70ff060742ec |
|
BLAKE2b-256 | d0e672287c1930356861eb722abca1c4216b349104dc265d481e5e844600cfe7 |
Hashes for ml_dtypes-0.0.4-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a03c5acc55a878fac190d428ef01438f930cbef3fb8625c8c8fd2e3adc277607 |
|
MD5 | 7d3c37b9c42fe017b96681b458ea2a6f |
|
BLAKE2b-256 | de38103585f600f51358ecbd44a46c0642e4b0bc079cde2c3a300d1a6915a632 |
Hashes for ml_dtypes-0.0.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e64869be11c830736c40513c47918c421a8385243846f1e8fd838793d866aa87 |
|
MD5 | c6b632f4a0f66e1a7352db40f92a1875 |
|
BLAKE2b-256 | ff6267dda04ed72d0dbbcabb212bd274ba862714e411832b7008e37e3206f6e8 |
Hashes for ml_dtypes-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc64866c1848999fab6f4a2938e769aed95b964085ebdcd7cd45e350192e457 |
|
MD5 | f736400894aaa8ac15612f7386c2f51f |
|
BLAKE2b-256 | 16c371cd6fc48d3f19a0b10a2461bc10db79c4895d96e04275fc95c2852f0453 |
Hashes for ml_dtypes-0.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b148131da64f85053b79380cf34471eb869f7c027e2198a0c86d5e6fc9531f |
|
MD5 | c8fcf9e67dc8cab818645b31cf1c8df2 |
|
BLAKE2b-256 | 7a71029908fbf45db1b68cf051833f33a0b5ed5bddd493cb98dfa1c5f5082bd0 |
Hashes for ml_dtypes-0.0.4-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23ff15cd9ba61cc42287097c30ae6841facd6dc14cc252f977d6430b8cd6eccc |
|
MD5 | 9e58fde19b57e7587e52128d23db2316 |
|
BLAKE2b-256 | 5741c7014efc5505a9fbc65f2189a40c25ab92f640e0abe30efc949895d5a6cb |
Hashes for ml_dtypes-0.0.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b28c6b7831fa2cbb3169ed3053f10fb11d0415e2f250b893eb874e3af747a1f3 |
|
MD5 | 584b559a0d646023600ec5382762776b |
|
BLAKE2b-256 | e6a7801c12cb1d8be753301d094992555baa63cb87b8f4e4e24b482900107086 |
Hashes for ml_dtypes-0.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2b651fa1f91ce83cf037db202cd2601ac9b649016ec8593459c0295e613bf47 |
|
MD5 | 79a28bfbf32f963dc500937d8190adbf |
|
BLAKE2b-256 | f9d69920006755e0415a3962ea961c643900152fec6ae5a00c2432974c716b86 |
Hashes for ml_dtypes-0.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a75ef23de72daf5efcc99799dfaa387386b79502a123909b0d3098ef84ffa6fa |
|
MD5 | c5f56cc477a0020b9119f56fd24219c2 |
|
BLAKE2b-256 | a74a283c5514dd47157073998d40a5f63f9b1023edc6ea1e2106f95480b47a59 |
Hashes for ml_dtypes-0.0.4-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85085f9dac85b1eee5f7d2044c47bb3df72abc7785d38d176744fde5782b76ce |
|
MD5 | 7c1316344901f6ed704abfa2f8c9ac91 |
|
BLAKE2b-256 | 886da7143fdad25ad591b23e8ca6799f1ecddddc68ac0d2fd9d612f37564af2c |