U32Array#

class vulkpy.U32Array#

Bases: _GPUArray

GPU Array of uint (32bit) for shape or indices

See also

vulkpy.Array

float (32bit) array supporing mathematical operation

Warning

U32Array doesn’t support any mathematical operation. This class is designed for indexing and class label.

Methods Summary

flush()

Flush Buffer to GPU

to_onehot(num_classes)

Convert to one hot vector

wait()

Wait Last Job

Methods Documentation

flush()#

Flush Buffer to GPU

to_onehot(num_classes: int) Array#

Convert to one hot vector

Parameters:

num_classes (int) – Number of classes

Returns:

One hot vector

Return type:

vulkpy.Array

wait()#

Wait Last Job

__init__(gpu: GPU, *, data: Iterable[int] | None = None, shape: Iterable[int] | None = None)#

Initialize U32Array

Parameters:
  • data (iterable of ints, optional) – Data to be copied.

  • shape (iterable of ints, optional) – Shape for uninitialized array. If data is not None, shape is ignored.

Raises:

ValueError – If neither data nor shape is specified.