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

public abstract class Bfloat16Indexer extends Indexer
Abstract indexer for the short primitive type, treated as bfloat16.
See Also:
  • Field Details

    • VALUE_BYTES

      public static final int VALUE_BYTES
      The number of bytes used to represent a short.
      See Also:
  • Constructor Details

    • Bfloat16Indexer

      protected Bfloat16Indexer(Index index)
    • Bfloat16Indexer

      protected Bfloat16Indexer(long[] sizes, long[] strides)
  • Method Details

    • create

      public static Bfloat16Indexer create(short[] array)
      Returns new Bfloat16ArrayIndexer(array)
    • create

      public static Bfloat16Indexer create(ShortBuffer buffer)
      Returns new Bfloat16BufferIndexer(buffer)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer)
      Returns new Bfloat16RawIndexer(pointer)
    • create

      public static Bfloat16Indexer create(short[] array, Index index)
      Returns new Bfloat16ArrayIndexer(array, index)
    • create

      public static Bfloat16Indexer create(ShortBuffer buffer, Index index)
      Returns new Bfloat16BufferIndexer(buffer, index)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer, Index index)
      Returns new Bfloat16RawIndexer(pointer, index)
    • create

      public static Bfloat16Indexer create(short[] array, long... sizes)
      Returns new Bfloat16ArrayIndexer(array, sizes)
    • create

      public static Bfloat16Indexer create(ShortBuffer buffer, long... sizes)
      Returns new Bfloat16BufferIndexer(buffer, sizes)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer, long... sizes)
      Returns new Bfloat16RawIndexer(pointer, sizes)
    • create

      public static Bfloat16Indexer create(short[] array, long[] sizes, long[] strides)
      Returns new Bfloat16ArrayIndexer(array, sizes, strides)
    • create

      public static Bfloat16Indexer create(ShortBuffer buffer, long[] sizes, long[] strides)
      Returns new Bfloat16BufferIndexer(buffer, sizes, strides)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides)
      Returns new Bfloat16RawIndexer(pointer, sizes, strides)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer, long[] sizes, long[] strides, boolean direct)
      Returns create(pointer, Index.create(sizes, strides), direct)
    • create

      public static Bfloat16Indexer create(ShortPointer pointer, Index index, boolean direct)
      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 array
      index - to use
      direct - true to use a direct buffer, see Indexer 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)
      Returns array/buffer[index(i)]
    • get

      public Bfloat16Indexer get(long i, float[] h)
      Returns this where h = array/buffer[index(i)]
    • get

      public abstract Bfloat16Indexer get(long i, float[] h, int offset, int length)
      Returns this where h[offset:offset + length] = array/buffer[index(i)]
    • get

      public abstract float get(long i, long j)
      Returns array/buffer[index(i, j)]
    • get

      public Bfloat16Indexer get(long i, long j, float[] h)
      Returns this where h = array/buffer[index(i, j)]
    • get

      public 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)]
    • get

      public abstract float get(long i, long j, long k)
      Returns array/buffer[index(i, j, k)]
    • get

      public abstract float get(long... indices)
      Returns array/buffer[index(indices)]
    • get

      public Bfloat16Indexer get(long[] indices, float[] h)
      Returns this where h = array/buffer[index(indices)]
    • get

      public abstract Bfloat16Indexer get(long[] indices, float[] h, int offset, int length)
      Returns this where h[offset:offset + length] = array/buffer[index(indices)]
    • put

      public abstract Bfloat16Indexer put(long i, float h)
      Returns this where array/buffer[index(i)] = h
    • put

      public Bfloat16Indexer put(long i, float... h)
      Returns this where array/buffer[index(i)] = h
    • put

      public abstract Bfloat16Indexer put(long i, float[] h, int offset, int length)
      Returns this where array/buffer[index(i)] = h[offset:offset + length]
    • put

      public abstract Bfloat16Indexer put(long i, long j, float h)
      Returns this where array/buffer[index(i, j)] = h
    • put

      public Bfloat16Indexer put(long i, long j, float... h)
      Returns this where array/buffer[index(i, j)] = h
    • put

      public 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]
    • put

      public abstract Bfloat16Indexer put(long i, long j, long k, float h)
      Returns this where array/buffer[index(i, j, k)] = h
    • put

      public abstract Bfloat16Indexer put(long[] indices, float h)
      Returns this where array/buffer[index(indices)] = h
    • put

      public Bfloat16Indexer put(long[] indices, float... h)
      Returns this where array/buffer[index(indices)] = h
    • put

      public abstract Bfloat16Indexer put(long[] indices, float[] h, int offset, int length)
      Returns this where array/buffer[index(indices)] = h[offset:offset + length]
    • getDouble

      public double getDouble(long... indices)
      Description copied from class: Indexer
      Calls get(int...indices) and returns the value as a double.
      Specified by:
      getDouble in class Indexer
    • putDouble

      public Bfloat16Indexer putDouble(long[] indices, double h)
      Description copied from class: Indexer
      Casts value to primitive type and calls put(long[] indices, <type> value).
      Specified by:
      putDouble in class Indexer