---
title: "concatenate(sources:dimension:)"
framework: ML Compute
role: symbol
role_heading: Instance Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlcgraph/concatenate(sources:dimension:)"
---

# concatenate(sources:dimension:)

Adds a new concatenation layer to the graph using the source tensors and concatenation dimension you specify.

## Declaration

```swift
func concatenate(sources: [MLCTensor], dimension: Int) -> MLCTensor?
```

## Parameters

- `sources`: An array that contains the source tensors.
- `dimension`: The concatenation dimension.

## Return Value

Return Value A result tensor.

## See Also

### Adding New Layers to Graphs

- [split(source:splitCount:dimension:)](mlcompute/mlcgraph/split(source:splitcount:dimension:).md)
- [split(source:splitSectionLengths:dimension:)](mlcompute/mlcgraph/split(source:splitsectionlengths:dimension:).md)
- [reshape(shape:source:)](mlcompute/mlcgraph/reshape(shape:source:).md)
- [gather(withDimension:source:indices:)](mlcompute/mlcgraph/gather(withdimension:source:indices:).md)
- [scatter(withDimension:source:indices:copyFrom:reductionType:)](mlcompute/mlcgraph/scatter(withdimension:source:indices:copyfrom:reductiontype:).md)
- [transpose(dimensions:source:)](mlcompute/mlcgraph/transpose(dimensions:source:).md)
