MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PyBfloat16_Int

Function PyBfloat16_Int

tensorflow/compiler/xla/python/bfloat16.cc:205–209  ·  view source on GitHub ↗

Converts a PyBfloat16 into a PyInt.

Source from the content-addressed store, hash-verified

203
204// Converts a PyBfloat16 into a PyInt.
205PyObject* PyBfloat16_Int(PyObject* self) {
206 bfloat16 x = PyBfloat16_Bfloat16(self);
207 long y = static_cast<long>(x); // NOLINT
208 return TfPyInt_FromLong(y);
209}
210
211// Negates a PyBfloat16.
212PyObject* PyBfloat16_Negative(PyObject* self) {

Callers

nothing calls this directly

Calls 2

PyBfloat16_Bfloat16Function · 0.70
TfPyInt_FromLongFunction · 0.70

Tested by

no test coverage detected