Converts a PyBfloat16 into a PyInt.
| 147 | |
| 148 | // Converts a PyBfloat16 into a PyInt. |
| 149 | PyObject* PyBfloat16_Int(PyObject* self) { |
| 150 | bfloat16 x = PyBfloat16_Bfloat16(self); |
| 151 | long y = static_cast<long>(x); // NOLINT |
| 152 | return TfPyInt_FromLong(y); |
| 153 | } |
| 154 | |
| 155 | // Negates a PyBfloat16. |
| 156 | PyObject* PyBfloat16_Negative(PyObject* self) { |
nothing calls this directly
no test coverage detected