Package org.bytedeco.javacpp.indexer
Class Bfloat16Indexer
java.lang.Object
org.bytedeco.javacpp.indexer.Indexer
org.bytedeco.javacpp.indexer.Bfloat16Indexer
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
Bfloat16ArrayIndexer
,Bfloat16BufferIndexer
,Bfloat16RawIndexer
Abstract indexer for the
short
primitive type, treated as bfloat16.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The number of bytes used to represent a short. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Bfloat16Indexer
(long[] sizes, long[] strides) protected
Bfloat16Indexer
(Index index) -
Method Summary
Modifier and TypeMethodDescriptionstatic Bfloat16Indexer
create
(short[] array) Returnsnew Bfloat16ArrayIndexer(array)
static Bfloat16Indexer
create
(short[] array, long... sizes) Returnsnew Bfloat16ArrayIndexer(array, sizes)
static Bfloat16Indexer
create
(short[] array, long[] sizes, long[] strides) Returnsnew Bfloat16ArrayIndexer(array, sizes, strides)
static Bfloat16Indexer
Returnsnew Bfloat16ArrayIndexer(array, index)
static Bfloat16Indexer
create
(ShortBuffer buffer) Returnsnew Bfloat16BufferIndexer(buffer)
static Bfloat16Indexer
create
(ShortBuffer buffer, long... sizes) Returnsnew Bfloat16BufferIndexer(buffer, sizes)
static Bfloat16Indexer
create
(ShortBuffer buffer, long[] sizes, long[] strides) Returnsnew Bfloat16BufferIndexer(buffer, sizes, strides)
static Bfloat16Indexer
create
(ShortBuffer buffer, Index index) Returnsnew Bfloat16BufferIndexer(buffer, index)
static Bfloat16Indexer
create
(ShortPointer pointer) Returnsnew Bfloat16RawIndexer(pointer)
static Bfloat16Indexer
create
(ShortPointer pointer, long... sizes) Returnsnew Bfloat16RawIndexer(pointer, sizes)
static Bfloat16Indexer
create
(ShortPointer pointer, long[] sizes, long[] strides) Returnsnew Bfloat16RawIndexer(pointer, sizes, strides)
static Bfloat16Indexer
create
(ShortPointer pointer, long[] sizes, long[] strides, boolean direct) Returnscreate(pointer, Index.create(sizes, strides), direct)
static Bfloat16Indexer
create
(ShortPointer pointer, Index index) Returnsnew Bfloat16RawIndexer(pointer, index)
static Bfloat16Indexer
create
(ShortPointer pointer, Index index, boolean direct) Creates a bfloat16 indexer to access efficiently the data of a pointer.static int
fromFloat
(float h) returns all higher 16 bits as 0 for all resultsabstract float
get
(long i) Returnsarray/buffer[index(i)]
abstract float
get
(long... indices) Returnsarray/buffer[index(indices)]
get
(long[] indices, float[] h) Returnsthis
whereh = array/buffer[index(indices)]
abstract Bfloat16Indexer
get
(long[] indices, float[] h, int offset, int length) Returnsthis
whereh[offset:offset + length] = array/buffer[index(indices)]
get
(long i, float[] h) Returnsthis
whereh = array/buffer[index(i)]
abstract Bfloat16Indexer
get
(long i, float[] h, int offset, int length) Returnsthis
whereh[offset:offset + length] = array/buffer[index(i)]
abstract float
get
(long i, long j) Returnsarray/buffer[index(i, j)]
get
(long i, long j, float[] h) Returnsthis
whereh = array/buffer[index(i, j)]
abstract Bfloat16Indexer
get
(long i, long j, float[] h, int offset, int length) Returnsthis
whereh[offset:offset + length] = array/buffer[index(i, j)]
abstract float
get
(long i, long j, long k) Returnsarray/buffer[index(i, j, k)]
double
getDouble
(long... indices) Callsget(int...indices)
and returns the value as a double.abstract Bfloat16Indexer
put
(long[] indices, float h) Returnsthis
wherearray/buffer[index(indices)] = h
put
(long[] indices, float... h) Returnsthis
wherearray/buffer[index(indices)] = h
abstract Bfloat16Indexer
put
(long[] indices, float[] h, int offset, int length) Returnsthis
wherearray/buffer[index(indices)] = h[offset:offset + length]
abstract Bfloat16Indexer
put
(long i, float h) Returnsthis
wherearray/buffer[index(i)] = h
put
(long i, float... h) Returnsthis
wherearray/buffer[index(i)] = h
abstract Bfloat16Indexer
put
(long i, float[] h, int offset, int length) Returnsthis
wherearray/buffer[index(i)] = h[offset:offset + length]
abstract Bfloat16Indexer
put
(long i, long j, float h) Returnsthis
wherearray/buffer[index(i, j)] = h
put
(long i, long j, float... h) Returnsthis
wherearray/buffer[index(i, j)] = h
abstract Bfloat16Indexer
put
(long i, long j, float[] h, int offset, int length) Returnsthis
wherearray/buffer[index(i, j)] = h[offset:offset + length]
abstract Bfloat16Indexer
put
(long i, long j, long k, float h) Returnsthis
wherearray/buffer[index(i, j, k)] = h
putDouble
(long[] indices, double h) Casts value to primitive type and callsput(long[] indices, <type> value)
.static float
toFloat
(int h) ignores the higher 16 bits
-
Field Details
-
VALUE_BYTES
public static final int VALUE_BYTESThe number of bytes used to represent a short.- See Also:
-
-
Constructor Details
-
Bfloat16Indexer
-
Bfloat16Indexer
protected Bfloat16Indexer(long[] sizes, long[] strides)
-
-
Method Details
-
create
Returnsnew Bfloat16ArrayIndexer(array)
-
create
Returnsnew Bfloat16BufferIndexer(buffer)
-
create
Returnsnew Bfloat16RawIndexer(pointer)
-
create
Returnsnew Bfloat16ArrayIndexer(array, index)
-
create
Returnsnew Bfloat16BufferIndexer(buffer, index)
-
create
Returnsnew Bfloat16RawIndexer(pointer, index)
-
create
Returnsnew Bfloat16ArrayIndexer(array, sizes)
-
create
Returnsnew Bfloat16BufferIndexer(buffer, sizes)
-
create
Returnsnew Bfloat16RawIndexer(pointer, sizes)
-
create
Returnsnew Bfloat16ArrayIndexer(array, sizes, strides)
-
create
Returnsnew Bfloat16BufferIndexer(buffer, sizes, strides)
-
create
Returnsnew Bfloat16RawIndexer(pointer, sizes, strides)
-
create
public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct) Returnscreate(pointer, Index.create(sizes, strides), direct)
-
create
Creates a bfloat16 indexer to access efficiently the data of a pointer.- Parameters:
pointer
- data to access via a buffer or to copy to an arrayindex
- to usedirect
-true
to use a direct buffer, seeIndexer
for details- Returns:
- the new bfloat16 indexer backed by the raw memory interface, a buffer, or an array
-
toFloat
public static float toFloat(int h) ignores the higher 16 bits -
fromFloat
public static int fromFloat(float h) returns all higher 16 bits as 0 for all results -
get
public abstract float get(long i) Returnsarray/buffer[index(i)]
-
get
Returnsthis
whereh = array/buffer[index(i)]
-
get
Returnsthis
whereh[offset:offset + length] = array/buffer[index(i)]
-
get
public abstract float get(long i, long j) Returnsarray/buffer[index(i, j)]
-
get
Returnsthis
whereh = array/buffer[index(i, j)]
-
get
Returnsthis
whereh[offset:offset + length] = array/buffer[index(i, j)]
-
get
public abstract float get(long i, long j, long k) Returnsarray/buffer[index(i, j, k)]
-
get
public abstract float get(long... indices) Returnsarray/buffer[index(indices)]
-
get
Returnsthis
whereh = array/buffer[index(indices)]
-
get
Returnsthis
whereh[offset:offset + length] = array/buffer[index(indices)]
-
put
Returnsthis
wherearray/buffer[index(i)] = h
-
put
Returnsthis
wherearray/buffer[index(i)] = h
-
put
Returnsthis
wherearray/buffer[index(i)] = h[offset:offset + length]
-
put
Returnsthis
wherearray/buffer[index(i, j)] = h
-
put
Returnsthis
wherearray/buffer[index(i, j)] = h
-
put
Returnsthis
wherearray/buffer[index(i, j)] = h[offset:offset + length]
-
put
Returnsthis
wherearray/buffer[index(i, j, k)] = h
-
put
Returnsthis
wherearray/buffer[index(indices)] = h
-
put
Returnsthis
wherearray/buffer[index(indices)] = h
-
put
Returnsthis
wherearray/buffer[index(indices)] = h[offset:offset + length]
-
getDouble
public double getDouble(long... indices) Description copied from class:Indexer
Callsget(int...indices)
and returns the value as a double. -
putDouble
Description copied from class:Indexer
Casts value to primitive type and callsput(long[] indices, <type> value)
.
-