matricize#
- ivy.matricize(x, /, row_modes, column_modes=None, *, out=None)[source]#
Matricizes the given tensor.
- Parameters:
x (
Union[Array,NativeArray]) – the input tensorrow_modes (
Sequence[int]) – modes to use as row of the matrix (in the desired order)column_modes (
Optional[Sequence[int]], default:None) – modes to use as column of the matrix, in the desired order if None, the modes not in row_modes will be used in ascending orderout (
Optional[Array], default:None) – optional output array, for writing the result to.ret –
------- – ivy.Array : tensor of size (ivy.prod(x.shape[i] for i in row_modes), -1)
- Return type:
- Array.matricize(self, /, row_modes, column_modes=None, *, out=None)[source]#
ivy.Array instance method variant of ivy.matricize. This method simply wraps the function, and so the docstring for ivy.matricize also applies to this method with minimal changes.
- Parameters:
self (
Union[Array,NativeArray]) – the input tensorrow_modes (
Sequence[int]) – modes to use as row of the matrix (in the desired order)column_modes (
Optional[Sequence[int]], default:None) – modes to use as column of the matrix, in the desired order if None, the modes not in row_modes will be used in ascending orderout (
Optional[Array], default:None) – optional output array, for writing the result to.ret –
------- – ivy.Array : tensor of size (ivy.prod(x.shape[i] for i in row_modes), -1)
- Return type:
Array
- Container.matricize(self, /, row_modes, column_modes=None, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#
ivy.Container instance method variant of ivy.matricize.
This method simply wraps the function, and so the docstring for ivy.matricize also applies to this method with minimal changes.
- Parameters:
self (
Union[Array,NativeArray,Container]) – the input tensorrow_modes (
Union[Sequence[int],Container]) – modes to use as row of the matrix (in the desired order)column_modes (
Optional[Union[Sequence[int],Container]], default:None) – modes to use as column of the matrix, in the desired order if None, the modes not in row_modes will be used in ascending orderout (
Optional[Container], default:None) – optional output array, for writing the result to.ret –
------- – ivy.Container
- Return type:
Container