nip.utils.nested_array_dict.concatenate_nested_array_dicts#
- nip.utils.nested_array_dict.concatenate_nested_array_dicts(nds: Sequence[NestedArrayDict], dim=0) NestedArrayDict [source]#
Concatenate a sequence of NestedArrayDicts along an existing dimension.
- Parameters:
nds (Sequence[NestedArrayDict]) – The NestedArrayDicts to concatenate. All NestedArrayDicts must have the same keys, shapes and batch sizes, except for the dimension to concatenate along.
dim (int, default=0) – The dimension to concatenate along. This must be a non-negative integer at most equal to the number of batch dimensions.
- Returns:
concatenated (NestedArrayDict) – The NestedArrayDict with the concatenated arrays. The batch size of the new NestedArrayDict is the batch size of the input NestedArrayDicts with the concatenated dimension removed.