view_shape

Contents

view_shape#

glue.utils.array.view_shape(shape, view)[source]#

Return the shape of a view of an array.

Returns equivalent of np.zeros(shape)[view].shape but with minimal memory usage.

Parameters:
shapetuple

The shape of the array

viewslice

A valid index into a Numpy array, or None