Bfloat16Layout
Stay organized with collections
Save and categorize content based on your preferences.
Data layout that converts 32-bit floats from/to 16-bit, truncating their mantissa to 7 bits but
preserving the 8-bit exponent with the same bias.
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 UTC."],[],[],null,["# Bfloat16Layout\n\npublic final class **Bfloat16Layout** \nData layout that converts 32-bit floats from/to 16-bit, truncating their mantissa to 7 bits but\npreserving the 8-bit exponent with the same bias. \n\n### Public Constructors\n\n|---|------------------------------------------------------------------------------------------------------------------|\n| | [Bfloat16Layout](/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout#Bfloat16Layout())() |\n\n### Public Methods\n\n|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| float | [readFloat](/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout#readFloat(org.tensorflow.ndarray.buffer.ShortDataBuffer, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, long index) |\n| void | [writeFloat](/jvm/api_docs/java/org/tensorflow/ndarray/impl/buffer/layout/Bfloat16Layout#writeFloat(org.tensorflow.ndarray.buffer.ShortDataBuffer, float, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, float value, long index) |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface [org.tensorflow.ndarray.buffer.layout.FloatDataLayout](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout) \n\n|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [FloatDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/FloatDataBuffer) | [applyTo](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout#applyTo(S))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer) Apply this layout to the provided buffer. |\n| abstract float | [readFloat](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout#readFloat(S, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, long index) Reads `n = scale()` values from the buffer at the given index and return them as a float. |\n| abstract Float | [readObject](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout#readObject(S, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, long index) Reads `n = scale()` values from the buffer at the given index and return them as a single value in the user type. |\n| abstract void | [writeFloat](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout#writeFloat(S, float, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, float value, long index) Writes a float into the buffer at the given index after converting it to the buffer type. |\n| abstract void | [writeObject](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/FloatDataLayout#writeObject(S, java.lang.Float, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, Float value, long index) |\n\nFrom interface [org.tensorflow.ndarray.buffer.layout.DataLayout](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/DataLayout) \n\n|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [DataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/DataBuffer)\\\u003cFloat\\\u003e | [applyTo](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/DataLayout#applyTo(S))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer) Apply this layout to the provided buffer. |\n| abstract Float | [readObject](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/DataLayout#readObject(S, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, long index) Reads `n = scale()` values from the buffer at the given index and return them as a single value in the user type. |\n| abstract int | [scale](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/DataLayout#scale())() Indicates the number of buffer values are required to represent a single user value, default is 1. |\n| abstract void | [writeObject](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/layout/DataLayout#writeObject(S, T, long))([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, Float value, long index) Writes a user value into the buffer at the given index after converting it to the buffer type. |\n\nPublic Constructors\n-------------------\n\n#### public\n**Bfloat16Layout**\n()\n\n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n#### public float\n**readFloat**\n([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, long index)\n\n\u003cbr /\u003e\n\n#### public void\n**writeFloat**\n([ShortDataBuffer](/jvm/api_docs/java/org/tensorflow/ndarray/buffer/ShortDataBuffer) buffer, float value, long index)\n\n\u003cbr /\u003e"]]