barray¶
-
class
minkit.barray(array, length=None, backend=None)[source]¶ Bases:
minkit.marrayArray of booleans.
Parameters: - array (numpy.ndarray or reikna.cluda.api.Array) – original array.
- length (int or None) – length of the array.
- backend (Backend or None) – backend where to put the array.
Attributes Summary
aopAssociated object to do array operations. backendBackend interface. dtypeData type. lengthLength as a numpy.int32instance.shapeShape of the array. uaUnderlying array. Methods Summary
as_ndarray()Return the underlying array as a numpy.ndarrayinstance.copy()Copy this array. count_nonzero()Count the number of elements that are different from zero. from_ndarray(a, backend)Create this class from a numpy.ndarrayinstance.get(index)Get an element of the array. to_backend(backend)Send the array to the given backend. Attributes Documentation
-
aop¶ Associated object to do array operations.
-
backend¶ Backend interface.
-
dtype¶ Data type.
-
length¶ Length as a
numpy.int32instance.
-
shape¶ Shape of the array.
-
ua¶ Underlying array.
Methods Documentation
-
as_ndarray()[source]¶ Return the underlying array as a
numpy.ndarrayinstance. If the underlying array is already of this type, no copy is done.Returns: underlying array as a numpy.ndarray.Return type: numpy.ndarray
-
copy()¶ Copy this array.
Returns: Copy of this array.
-
count_nonzero()[source]¶ Count the number of elements that are different from zero.
Returns: number of elements different from zero. Return type: int
-
classmethod
from_ndarray(a, backend)[source]¶ Create this class from a
numpy.ndarrayinstance.Parameters: - a (numpy.ndarray) – array.
- backend (Backend) – backend where to create this array.
Returns: Newly created array.