<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTrainingGraph/link(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCTrainingGraph(im)linkWithGraphs:"
  },
  "title" : "link(with:)"
}
-->

# link(with:)

Links the training graphs you specify.

```
func link(with graphs: [MLCTrainingGraph]) -> Bool
```

## Parameters

`graphs`

An array that contains the training graphs.

## Return Value

`true` if the operation was successful.

## Discussion

When there are tensors shared by one or more layers in multiple sub-graphs, use this method to link subsequent training graphs with the first training sub-graph.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)