---
title: MLCGraph
framework: ML Compute
role: symbol
role_heading: Class
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlcgraph
---

# MLCGraph

A graph of layers you use to build a training or inference graph.

## Declaration

```swift
class MLCGraph
```

## Topics

### Adding Layers to Graphs

- [node(with:source:)](mlcompute/mlcgraph/node(with:source:).md)
- [node(with:sources:)](mlcompute/mlcgraph/node(with:sources:).md)
- [node(with:sources:disableUpdate:)](mlcompute/mlcgraph/node(with:sources:disableupdate:).md)
- [node(with:sources:lossLabels:)](mlcompute/mlcgraph/node(with:sources:losslabels:).md)

### 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)
- [concatenate(sources:dimension:)](mlcompute/mlcgraph/concatenate(sources: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)

### Associating Data with Input Tensors

- [bindAndWriteData(_:forInputs:to:batchSize:synchronous:)](mlcompute/mlcgraph/bindandwritedata(_:forinputs:to:batchsize:synchronous:).md)
- [bindAndWriteData(_:forInputs:to:synchronous:)](mlcompute/mlcgraph/bindandwritedata(_:forinputs:to:synchronous:).md)

### Inspecting Graphs

- [sourceTensors(for:)](mlcompute/mlcgraph/sourcetensors(for:).md)
- [resultTensors(for:)](mlcompute/mlcgraph/resulttensors(for:).md)
- [device](mlcompute/mlcgraph/device.md)
- [layers](mlcompute/mlcgraph/layers.md)
- [summarizedDOTDescription](mlcompute/mlcgraph/summarizeddotdescription.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [MLCInferenceGraph](mlcompute/mlcinferencegraph.md)
- [MLCTrainingGraph](mlcompute/mlctraininggraph.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Graphs

- [MLCTrainingGraph](mlcompute/mlctraininggraph.md)
- [MLCInferenceGraph](mlcompute/mlcinferencegraph.md)
