Skip to content

Ticket #1789: Support half floats via buffer interface #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

elistevens
Copy link

Changes (and tests) to allow exporting half-floats through the buffer interface.

Code:
Added NPY_HALF to switch (descr->type_num) in _buffer_format_string.
Added 'e' keys to the _pep3118_native_map and _pep3118_standard_map.

Tests:
Added entries to the generic round-trip tests.
Added specialized half-float test that round-trips example values from the wikipedia page.

http://en.wikipedia.org/wiki/Half_precision_floating-point_format
http://mail.scipy.org/pipermail/numpy-discussion/2011-March/055795.html
http://projects.scipy.org/numpy/ticket/1789

… interface.

Code:
Added NPY_HALF to switch (descr->type_num) in _buffer_format_string.
Added 'e' keys to the _pep3118_native_map and _pep3118_standard_map.

Tests:
Added entries to the generic round-trip tests.
Added specialized half-float test that round-trips example values from the wikipedia page.

http://en.wikipedia.org/wiki/Half_precision_floating-point_format
http://mail.scipy.org/pipermail/numpy-discussion/2011-March/055795.html
@mwiebe mwiebe closed this Apr 2, 2011
fangerer pushed a commit to hpyproject/numpy-hpy that referenced this pull request Jul 7, 2022
…ython

Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from tim/gp-fixes-mk42 to labs-hpy-port

* commit '428dd2c4ee7bd1e31a0675a5a511e71ef1735f2b':
  add helper function to migrate PyDict_GetItemWithError
  migrate NPY_*_THREADS macros in various files to hpy
  dup resolver_info immediately when keeping it for later
  fix for porting PyDict_GetItemWithError
  HPy workaround: re-order sq_item slot to come after mp_subscript
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
feat: Add vdup_n_[s16|s32|f32|u16|u32|s64|u64]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants