nums.core.array.blockarray module

class nums.core.array.blockarray.BlockArray(grid, cm, blocks=None)[source]

Bases: nums.core.array.base.BlockArrayBase

astype(dtype)[source]
check_or_convert_other(other, compute_block_shape=False)[source]
copy()[source]
classmethod create(create_op_name, shape, block_shape, dtype, cm)[source]
classmethod empty(shape, block_shape, dtype, cm)[source]
expand_dims(axis)[source]

This function refers to the numpy implementation of expand_dims.

flattened_oids()[source]
classmethod from_blocks(arr, result_shape, cm)[source]
classmethod from_np(arr, block_shape, copy, cm)[source]
classmethod from_oid(oid, shape, dtype, cm)[source]
classmethod from_scalar(val, cm)[source]
is_single_block()[source]
reduce_axis(op_name, axis, keepdims=False)[source]
reshape(*shape, **kwargs)[source]
squeeze()[source]
swapaxes(axis1, axis2)[source]
tensordot(other, axes=2)[source]
static to_block_array(obj, cm, block_shape=None)[source]
to_single_block(replicate=False)[source]
touch()[source]

“Touch” an array. This is an efficient distributed “wait” operation.

transpose(defer=False, redistribute=False)[source]

Transpose this matrix. Only use defer with arithmetic operations. Setting redistribute to True may significantly impact performance. :param defer: When true, the transpose operation will be applied with the next arithmetic operation. :param redistribute: If defer is false, setting this to true will redistribute the data according to the device grid (data placement policy). This parameter has no effect when defer is true. :return: The transposed matrix.

ufunc(op_name)[source]
class nums.core.array.blockarray.Reshape[source]

Bases: object

static compute_shape(shape, input_shape)[source]