ArrayContainer

class cubie.batchsolving.arrays.BaseArrayManager.ArrayContainer[source]

Bases: ABC

Store per-array metadata and references for CUDA managers.

array_names() List[str][source]

Return array labels managed by this container.

attach(label: str, array: ndarray[Any, dtype[_ScalarType_co]]) None[source]

Attach an array to this container.

delete(label: str) None[source]

Delete reference to an array.

delete_all() None[source]

Delete all array references.

get_array(label: str) ndarray[Any, dtype[_ScalarType_co]] | FakeCUDAArray | None[source]

Return the stored array for label.

get_managed_array(label: str) ManagedArray[source]

Retrieve the metadata wrapper for label.

iter_managed_arrays() Iterator[tuple[str, ManagedArray]][source]

Yield (label, managed) pairs for each array.

property memory_type: str

Return the memory type of the first managed array.

set_array(label: str, array: ndarray[Any, dtype[_ScalarType_co]] | FakeCUDAArray | None) None[source]

Attach an array reference to label.

set_memory_type(memory_type: str) None[source]

Apply memory_type to all managed arrays.