public abstract class Bfloat16Indexer extends Indexer
short primitive type, treated as bfloat16.| Modifier and Type | Field and Description |
|---|---|
static int |
VALUE_BYTES
The number of bytes used to represent a short.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Bfloat16Indexer(Index index) |
protected |
Bfloat16Indexer(long[] sizes,
long[] strides) |
| Modifier and Type | Method and Description |
|---|---|
static Bfloat16Indexer |
create(short[] array)
Returns
new Bfloat16ArrayIndexer(array) |
static Bfloat16Indexer |
create(short[] array,
Index index)
Returns
new Bfloat16ArrayIndexer(array, index) |
static Bfloat16Indexer |
create(short[] array,
long... sizes)
Returns
new Bfloat16ArrayIndexer(array, sizes) |
static Bfloat16Indexer |
create(short[] array,
long[] sizes,
long[] strides)
Returns
new Bfloat16ArrayIndexer(array, sizes, strides) |
static Bfloat16Indexer |
create(ShortBuffer buffer)
Returns
new Bfloat16BufferIndexer(buffer) |
static Bfloat16Indexer |
create(ShortBuffer buffer,
Index index)
Returns
new Bfloat16BufferIndexer(buffer, index) |
static Bfloat16Indexer |
create(ShortBuffer buffer,
long... sizes)
Returns
new Bfloat16BufferIndexer(buffer, sizes) |
static Bfloat16Indexer |
create(ShortBuffer buffer,
long[] sizes,
long[] strides)
Returns
new Bfloat16BufferIndexer(buffer, sizes, strides) |
static Bfloat16Indexer |
create(ShortPointer pointer)
Returns
new Bfloat16RawIndexer(pointer) |
static Bfloat16Indexer |
create(ShortPointer pointer,
Index index)
Returns
new 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 Bfloat16Indexer |
create(ShortPointer pointer,
long... sizes)
Returns
new Bfloat16RawIndexer(pointer, sizes) |
static Bfloat16Indexer |
create(ShortPointer pointer,
long[] sizes,
long[] strides)
Returns
new Bfloat16RawIndexer(pointer, sizes, strides) |
static Bfloat16Indexer |
create(ShortPointer pointer,
long[] sizes,
long[] strides,
boolean direct)
Returns
create(pointer, Index.create(sizes, strides), direct) |
static int |
fromFloat(float h)
returns all higher 16 bits as 0 for all results
|
abstract float |
get(long... indices)
Returns
array/buffer[index(indices)] |
abstract float |
get(long i)
Returns
array/buffer[index(i)] |
Bfloat16Indexer |
get(long[] indices,
float[] h)
Returns
this where h = array/buffer[index(indices)] |
abstract Bfloat16Indexer |
get(long[] indices,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(indices)] |
Bfloat16Indexer |
get(long i,
float[] h)
Returns
this where h = array/buffer[index(i)] |
abstract Bfloat16Indexer |
get(long i,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(i)] |
abstract float |
get(long i,
long j)
Returns
array/buffer[index(i, j)] |
Bfloat16Indexer |
get(long i,
long j,
float[] h)
Returns
this where h = array/buffer[index(i, j)] |
abstract Bfloat16Indexer |
get(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where h[offset:offset + length] = array/buffer[index(i, j)] |
abstract float |
get(long i,
long j,
long k)
Returns
array/buffer[index(i, j, k)] |
double |
getDouble(long... indices)
Calls
get(int...indices) and returns the value as a double. |
Bfloat16Indexer |
put(long[] indices,
float... h)
Returns
this where array/buffer[index(indices)] = h |
abstract Bfloat16Indexer |
put(long[] indices,
float h)
Returns
this where array/buffer[index(indices)] = h |
abstract Bfloat16Indexer |
put(long[] indices,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(indices)] = h[offset:offset + length] |
Bfloat16Indexer |
put(long i,
float... h)
Returns
this where array/buffer[index(i)] = h |
abstract Bfloat16Indexer |
put(long i,
float h)
Returns
this where array/buffer[index(i)] = h |
abstract Bfloat16Indexer |
put(long i,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(i)] = h[offset:offset + length] |
Bfloat16Indexer |
put(long i,
long j,
float... h)
Returns
this where array/buffer[index(i, j)] = h |
abstract Bfloat16Indexer |
put(long i,
long j,
float h)
Returns
this where array/buffer[index(i, j)] = h |
abstract Bfloat16Indexer |
put(long i,
long j,
float[] h,
int offset,
int length)
Returns
this where array/buffer[index(i, j)] = h[offset:offset + length] |
abstract Bfloat16Indexer |
put(long i,
long j,
long k,
float h)
Returns
this where array/buffer[index(i, j, k)] = h |
Bfloat16Indexer |
putDouble(long[] indices,
double h)
Casts value to primitive type and calls
put(long[] indices, <type> value). |
static float |
toFloat(int h)
ignores the higher 16 bits
|
public static final int VALUE_BYTES
protected Bfloat16Indexer(Index index)
protected Bfloat16Indexer(long[] sizes,
long[] strides)
public static Bfloat16Indexer create(short[] array)
new Bfloat16ArrayIndexer(array)public static Bfloat16Indexer create(ShortBuffer buffer)
new Bfloat16BufferIndexer(buffer)public static Bfloat16Indexer create(ShortPointer pointer)
new Bfloat16RawIndexer(pointer)public static Bfloat16Indexer create(short[] array, Index index)
new Bfloat16ArrayIndexer(array, index)public static Bfloat16Indexer create(ShortBuffer buffer, Index index)
new Bfloat16BufferIndexer(buffer, index)public static Bfloat16Indexer create(ShortPointer pointer, Index index)
new Bfloat16RawIndexer(pointer, index)public static Bfloat16Indexer create(short[] array, long... sizes)
new Bfloat16ArrayIndexer(array, sizes)public static Bfloat16Indexer create(ShortBuffer buffer, long... sizes)
new Bfloat16BufferIndexer(buffer, sizes)public static Bfloat16Indexer create(ShortPointer pointer, long... sizes)
new Bfloat16RawIndexer(pointer, sizes)public static Bfloat16Indexer create(short[] array, long[] sizes, long[] strides)
new Bfloat16ArrayIndexer(array, sizes, strides)public static Bfloat16Indexer create(ShortBuffer buffer, long[] sizes, long[] strides)
new Bfloat16BufferIndexer(buffer, sizes, strides)public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides)
new Bfloat16RawIndexer(pointer, sizes, strides)public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
create(pointer, Index.create(sizes, strides), direct)public static Bfloat16Indexer create(ShortPointer pointer, Index index, boolean direct)
pointer - data to access via a buffer or to copy to an arrayindex - to usedirect - true to use a direct buffer, see Indexer for detailspublic static float toFloat(int h)
public static int fromFloat(float h)
public abstract float get(long i)
array/buffer[index(i)]public Bfloat16Indexer get(long i, float[] h)
this where h = array/buffer[index(i)]public abstract Bfloat16Indexer get(long i, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(i)]public abstract float get(long i,
long j)
array/buffer[index(i, j)]public Bfloat16Indexer get(long i, long j, float[] h)
this where h = array/buffer[index(i, j)]public abstract Bfloat16Indexer get(long i, long j, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(i, j)]public abstract float get(long i,
long j,
long k)
array/buffer[index(i, j, k)]public abstract float get(long... indices)
array/buffer[index(indices)]public Bfloat16Indexer get(long[] indices, float[] h)
this where h = array/buffer[index(indices)]public abstract Bfloat16Indexer get(long[] indices, float[] h, int offset, int length)
this where h[offset:offset + length] = array/buffer[index(indices)]public abstract Bfloat16Indexer put(long i, float h)
this where array/buffer[index(i)] = hpublic Bfloat16Indexer put(long i, float... h)
this where array/buffer[index(i)] = hpublic abstract Bfloat16Indexer put(long i, float[] h, int offset, int length)
this where array/buffer[index(i)] = h[offset:offset + length]public abstract Bfloat16Indexer put(long i, long j, float h)
this where array/buffer[index(i, j)] = hpublic Bfloat16Indexer put(long i, long j, float... h)
this where array/buffer[index(i, j)] = hpublic abstract Bfloat16Indexer put(long i, long j, float[] h, int offset, int length)
this where array/buffer[index(i, j)] = h[offset:offset + length]public abstract Bfloat16Indexer put(long i, long j, long k, float h)
this where array/buffer[index(i, j, k)] = hpublic abstract Bfloat16Indexer put(long[] indices, float h)
this where array/buffer[index(indices)] = hpublic Bfloat16Indexer put(long[] indices, float... h)
this where array/buffer[index(indices)] = hpublic abstract Bfloat16Indexer put(long[] indices, float[] h, int offset, int length)
this where array/buffer[index(indices)] = h[offset:offset + length]public double getDouble(long... indices)
Indexerget(int...indices) and returns the value as a double.public Bfloat16Indexer putDouble(long[] indices, double h)
Indexerput(long[] indices, <type> value).Copyright © 2023. All rights reserved.