quri_parts.qsub.param module

class ArrayRef(array)

Bases: Generic[T]

An object that holds a reference to an array.

It is provided to avoid unnecessary copying when large numerical arrays are used as the Param of Op. Equivalence between ArrayRef instances is determined by the instance ids of the internal arrays.

Examples

import numpy as np

xs = np.arange(5)
ys = xs
zs = np.arange(5)

a = ArrayRef(xs)
b = ArrayRef(ys)
c = ArrayRef(zs)

assert a == b
assert a != c

d = a
e = copy.copy(d)
f = copy.deepcopy(e)

assert a == d
assert a == e
assert a != f
Parameters:

array (ndarray[Any, dtype[T]])

array: ndarray[Any, dtype[T]]