concat_from_sequence#
- ivy.concat_from_sequence(input_sequence, /, *, new_axis=0, axis=0, out=None)[source]#
Concatenate a sequence of arrays along a new or an existing axis.
- Parameters:
input_sequence (
Union[Tuple[Union[Array,NativeArray]],List[Union[Array,NativeArray]]]) – A sequence of arrays.new_axis (
int, default:0) – Insert and concatenate on a new axis or not, default 0 means do not insert new axis. new_axis = 0: concatenate new_axis = 1: stackaxis (
int, default:0) – axis along which the arrays will be concatenated.out (
Optional[Array], default:None) – optional output array, for writing the result to.
- Return type:
- Returns:
ret – Output Array
- Array.concat_from_sequence(self, /, input_sequence, *, new_axis=0, axis=0, out=None)[source]#
Concatenate a sequence of arrays along a new or an existing axis.
- Parameters:
self (
Array) – Array input.input_sequence (
Union[Tuple[Union[Array,NativeArray]],List[Union[Array,NativeArray]]]) – A sequence of arrays.new_axis (
int, default:0) – Insert and concatenate on a new axis or not, default 0 means do not insert new axis. new_axis = 0: concatenate new_axis = 1: stackaxis (
int, default:0) – The axis along which the arrays will be concatenated.out (
Optional[Array], default:None) – Optional output array, for writing the result to.
- Return type:
Array- Returns:
ret – Output Array
- Container.concat_from_sequence(self, /, input_sequence, *, new_axis=0, axis=0, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)[source]#
ivy.Container instance method variant of ivy.stack. This method simply wraps the function, and so the docstring for ivy.stack also applies to this method with minimal changes.
- Parameters:
self (
Container) –- Container with leaves to join with leaves of other arrays/containers.
Each array leave must have the same shape.
input_sequence (
Union[Tuple[Union[Array,NativeArray,Container]],List[Union[Array,NativeArray,Container]]]) – Container with other leaves to join. Each array leave must have the same shape.new_axis (
Union[int,Container], default:0) – Insert and concatenate on a new axis or not, default 0 means do not insert new axis. new_axis = 0: concatenate new_axis = 1: stackaxis (
Union[int,Container], default:0) – axis along which the array leaves will be concatenated. More details can be found in the docstring for ivy.stack.key_chains (
Optional[Union[List[str],Dict[str,str],Container]], default:None) – The key-chains to apply or not apply the method to. Default isNone.to_apply (
Union[bool,Container], default:True) – If True, the method will be applied to key_chains, otherwise key_chains will be skipped. Default isTrue.prune_unapplied (
Union[bool,Container], default:False) – Whether to prune key_chains for which the function was not applied. Default isFalse.map_sequences (
Union[bool,Container], default:False) – Whether to also map method to sequences (lists, tuples). Default isFalse.out (
Optional[Container], default:None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.
- Return type:
Container- Returns:
ret – an output container with the results.
Examples
>>> x = ivy.Container(a=ivy.array([[0, 1], [2,3]]), b=ivy.array([[4, 5]])) >>> y = ivy.Container(a=ivy.array([[3, 2], [1,0]]), b=ivy.array([[1, 0]])) >>> z = ivy.Container.static_concat_from_sequence([x,y],axis=1) >>> print(z) { a: ivy.array([[[0, 1], [3, 2]], [[2, 3], [1, 0]]]), b: ivy.array([[[4, 5], [1, 0]]]) }