| 1540 | } |
| 1541 | |
| 1542 | StatusOr<py::object> Bfloat16Dtype() { |
| 1543 | if (npy_bfloat16 < 0) { |
| 1544 | // Not yet initialized. We assume the GIL protects npy_bfloat16. |
| 1545 | if (!Initialize()) { |
| 1546 | return InternalError("Bfloat16 numpy type initialization failed."); |
| 1547 | } |
| 1548 | } |
| 1549 | return py::object(reinterpret_cast<PyObject*>(&PyBfloat16_Type), |
| 1550 | /*is_borrowed=*/true); |
| 1551 | } |
| 1552 | |
| 1553 | } // namespace xla |
nothing calls this directly
no test coverage detected