Array#
- class vulkpy.Array#
Bases:
_GPUArray
GPU Array for float (32bit)
Methods Summary
abs
([inplace])Element-wise Abs
acos
([inplace])Element-wise acos()
acosh
([inplace])Element-wise acosh()
asin
([inplace])Element-wise asin()
asinh
([inplace])Element-wise asinh()
atan
([inplace])Element-wise atan()
atanh
([inplace])Element-wise atanh()
broadcast_to
(shape)Broadcast to new shape
clamp
(min, max[, inplace])Element-wise clamp()
cos
([inplace])Element-wise cos()
cosh
([inplace])Element-wise cosh()
exp
([inplace])Element-wise exp()
exp2
([inplace])Element-wise exp2()
flush
()Flush Buffer to GPU
gather
(indices[, axis])Gather values of indices
invsqrt
([inplace])Element-wise 1/sqrt()
log
([inplace])Element-wise log()
log2
([inplace])Element-wise log2()
max
(other[, inplace])Element-wise Max
maximum
([axis, keepdims, rebroadcast])Get Maximum Value
mean
([axis, keepdims, rebroadcast])Calculate Mean Value
min
(other[, inplace])Element-wise Min
minimum
([axis, keepdims, rebroadcast])Get Minimum Value
prod
([axis, keepdims, rebroadcast])Calculate Product of Elements
reshape
(shape)Reshape of this array
sign
([inplace])Element-wise sign
sin
([inplace])Element-wise sin()
sinh
([inplace])Element-wise sinh()
sqrt
([inplace])Element-wise sqrt()
sum
([axis, keepdims, rebroadcast])Calculate Sum of Elements
tan
([inplace])Element-wise tan()
tanh
([inplace])Element-wise tanh()
wait
()Wait Last Job
Methods Documentation
- abs(inplace: bool = False) Array #
Element-wise Abs
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
abs array
- Return type:
- acos(inplace: bool = False) Array #
Element-wise acos()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
acos array
- Return type:
- acosh(inplace: bool = False) Array #
Element-wise acosh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
acosh array
- Return type:
- asin(inplace: bool = False) Array #
Element-wise asin()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
asin array
- Return type:
- asinh(inplace: bool = False) Array #
Element-wise asinh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
asinh array
- Return type:
- atan(inplace: bool = False) Array #
Element-wise atan()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
atan array
- Return type:
- atanh(inplace: bool = False) Array #
Element-wise atanh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
atanh array
- Return type:
- broadcast_to(shape: Iterable[int]) Array #
Broadcast to new shape
- Parameters:
shape (iterable of ints) – Shape of broadcast target
- Returns:
Broadcasted array
- Return type:
- Raises:
ValueError – If
shape
is not compatible.
- cos(inplace: bool = False) Array #
Element-wise cos()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
cos array
- Return type:
- cosh(inplace: bool = False) Array #
Element-wise cosh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
cosh array
- Return type:
- exp(inplace: bool = False) Array #
Element-wise exp()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
exp array
- Return type:
- exp2(inplace: bool = False) Array #
Element-wise exp2()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
exp2 array
- Return type:
- flush()#
Flush Buffer to GPU
- gather(indices: U32Array, axis: int | None = None) Array #
Gather values of indices
- Parameters:
indices (vulkpy.U32Array) – Indices
axis (int, optional) – Axis of gather. If
None
(default), array is flattened beforehand.
- Returns:
Gathered array
- Return type:
- invsqrt(inplace: bool = False) Array #
Element-wise 1/sqrt()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
1/sqrt array
- Return type:
- log(inplace: bool = False) Array #
Element-wise log()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
log array
- Return type:
- log2(inplace: bool = False) Array #
Element-wise log2()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
log2 array
- Return type:
- maximum(axis: None | int | Iterable[int] = None, keepdims: bool = False, rebroadcast: bool = False) Array #
Get Maximum Value
- Parameters:
axis (int, optional) – Reduction axis
keepdims (bool, optional) – When True, reduced dimensions are keeped with size one. Default is False.
rebroadcast (bool, optional) – When True, keep shape by re-broadcasting after reduce. Default is False.
- Returns:
Maximum array
- Return type:
- mean(axis: None | int | Iterable[int] = None, keepdims: bool = False, rebroadcast: bool = False) Array #
Calculate Mean Value
- Parameters:
axis (int, optional) – Reduction axis
keepdims (bool, optional) – When True, reduced dimensions are keeped with size one. Default is False.
rebroadcast (bool, optional) – When True, keep shape by re-broadcasting after reduce. Default is False.
- Returns:
Mean array
- Return type:
- minimum(axis: None | int | Iterable[int] = None, keepdims: bool = False, rebroadcast: bool = False) Array #
Get Minimum Value
- Parameters:
axis (int, optional) – Reduction axis
keepdims (bool, optional) – When True, reduced dimensions are keeped with size one. Default is False.
rebroadcast (bool, optional) – When True, keep shape by re-broadcasting after reduce. Default is False.
- Returns:
Minimum array
- Return type:
- prod(axis: None | int | Iterable[int] = None, keepdims: bool = False, rebroadcast: bool = False) Array #
Calculate Product of Elements
- Parameters:
axis (int, optional) – Reduction axis
keepdims (bool, optional) – When True, reduced dimensions are keeped with size one. Default is False.
rebroadcast (bool, optional) – When True, keep shape by re-broadcasting after reduce. Default is False.
- Returns:
Producted array
- Return type:
- reshape(shape: Iterable[int])#
Reshape of this array
- Parameters:
shape (iterable of int) – New shape
- Raises:
ValueError – If
shape
is incompatible
- sign(inplace: bool = False) Array #
Element-wise sign
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
sign array
- Return type:
- sin(inplace: bool = False) Array #
Element-wise sin()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
sin array
- Return type:
- sinh(inplace: bool = False) Array #
Element-wise sinh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
sinh array
- Return type:
- sqrt(inplace: bool = False) Array #
Element-wise sqrt()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
sqrt array
- Return type:
- sum(axis: None | int | Iterable[int] = None, keepdims: bool = False, rebroadcast: bool = False) Array #
Calculate Sum of Elements
- Parameters:
axis (int, optional) – Reduction axis
keepdims (bool, optional) – When True, reduced dimensions are keeped with size one. Default is False.
rebroadcast (bool, optional) – When True, keep shape by re-broadcasting after reduce. Default is False.
- Returns:
Summarized array
- Return type:
- tan(inplace: bool = False) Array #
Element-wise tan()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
tan array
- Return type:
- tanh(inplace: bool = False) Array #
Element-wise tanh()
- Parameters:
inplace (bool) – If
True
, update inplace, otherwise returns new array. Default value isFalse
.- Returns:
tanh array
- Return type:
- wait()#
Wait Last Job