擅长:python、mysql、java
<p>试试这个:</p>
<pre class="lang-py prettyprint-override"><code>from tensorflow.python import _pywrap_bfloat16
bfloat16 = _pywrap_bfloat16.TF_bfloat16_type()
print(bfloat16)
# <class 'bfloat16'>
print(bfloat16(1.0))
# bfloat16(1)
</code></pre>