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

Function PyBfloat16_Int

tensorflow/python/lib/core/bfloat16.cc:149–153  ·  view source on GitHub ↗

Converts a PyBfloat16 into a PyInt.

Source from the content-addressed store, hash-verified

147
148// Converts a PyBfloat16 into a PyInt.
149PyObject* 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.
156PyObject* 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