| 715 | } // namespace |
| 716 | |
| 717 | void RegisterNumpyBfloat16() { |
| 718 | if (npy_bfloat16_ >= 0) { |
| 719 | // Already initialized. |
| 720 | return; |
| 721 | } |
| 722 | if (!Initialize()) { |
| 723 | if (!PyErr_Occurred()) { |
| 724 | PyErr_SetString(PyExc_RuntimeError, "cannot load bfloat16 module."); |
| 725 | } |
| 726 | PyErr_Print(); |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | PyObject* Bfloat16PyType() { |
| 731 | CHECK(PyBfloat16_Type.tp_base != nullptr); |
nothing calls this directly
no test coverage detected