expand
¶
expand(array: array, new_shape: tuple) -> array
Expand the dimensions of an array to a new shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
array
|
The array to expand. |
required |
new_shape
|
tuple
|
The new shape desired. The new dimensions must be compatible with the original shape of the array. |
required |
Returns:
| Type | Description |
|---|---|
array
|
A view of the array with the new shape. |
Source code in mlx_graphs/utils/array_ops.py
from mlx_graphs.utils.array_ops import expand · mlx_graphs/utils/array_ops.py