marray¶
-
class
minkit.
marray
(array, dtype, length=None, backend=None)[source]¶ Bases:
object
Wrapper over the arrays to do operations in CPU or GPU devices.
- Parameters
array (numpy.ndarray or reikna.cluda.api.Array) – original array.
int – (GPU only) actual size of the array.
backend (Backend) – backend where to put the array.
Attributes Summary
Associated object to do array operations.
Backend interface.
Data type.
Length as a
numpy.int32
instance.Shape of the array.
Underlying array.
Methods Summary
Return the underlying array as a
numpy.ndarray
instance.copy
()Copy this array.
from_ndarray
(a, backend)Create this class from a
numpy.ndarray
instance.get
(i)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.int32
instance.
-
shape
¶ Shape of the array.
-
ua
¶ Underlying array.
Methods Documentation
-
as_ndarray
()[source]¶ Return the underlying array as a
numpy.ndarray
instance. If the underlying array is already of this type, no copy is done.- Returns
underlying array as a
numpy.ndarray
.- Return type
-
classmethod
from_ndarray
(a, backend)[source]¶ Create this class from a
numpy.ndarray
instance.- Parameters
a (numpy.ndarray) – array.
backend (Backend) – backend where to create this array.
- Returns
Newly created array.