<!--
{
  "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/addInputs(_:lossLabels:lossLabelWeights:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCTrainingGraph(im)addInputs:lossLabels:lossLabelWeights:"
  },
  "title" : "addInputs(_:lossLabels:lossLabelWeights:)"
}
-->

# addInputs(_:lossLabels:lossLabelWeights:)

Adds the inputs, loss labels, and loss label weights that you specify to the training graph.

```
func addInputs(_ inputs: [String : MLCTensor], lossLabels: [String : MLCTensor]?, lossLabelWeights: [String : MLCTensor]?) -> Bool
```

## Parameters

`inputs`

A dictionary that contains inputs.

`lossLabels`

A dictionary that contains loss label inputs.

`lossLabelWeights`

A dictionary that contains loss label weights.

## Return Value

`true` if the operation was successful.

## Discussion

Each input, loss label, or label weights tensor has a string identifier. When you execute the training graph, the string identifies which data object is the input for each tensor whose device memory requires updating before the framework actually executes the 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)