larray.LArray.reshape_like¶
-
LArray.
reshape_like
(self, target)[source]¶ Same as reshape but with an array as input. Total size (= number of stored data) of the two arrays must be equal.
See also
reshape
returns a LArray with a new shape given a list of axes.
Examples
>>> arr = zeros((2, 2, 2), dtype=int) >>> arr {0}* {1}*\{2}* 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 >>> new_arr = arr.reshape_like(ndtest((2, 4))) >>> new_arr a\b b0 b1 b2 b3 a0 0 0 0 0 a1 0 0 0 0