---
title: "addInputs(_:lossLabels:lossLabelWeights:)"
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/mlctraininggraph/addinputs(_:losslabels:losslabelweights:)"
---

# addInputs(_:lossLabels:lossLabelWeights:)

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

## Declaration

```swift
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

Return Value true if the operation was successful.

## Discussion

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.

## See Also

### Preparing Training Graphs

- [addInputs(_:lossLabels:)](mlcompute/mlctraininggraph/addinputs(_:losslabels:).md)
- [addOutputs(_:)](mlcompute/mlctraininggraph/addoutputs(_:).md)
- [stopGradient(for:)](mlcompute/mlctraininggraph/stopgradient(for:).md)
- [compileOptimizer(_:)](mlcompute/mlctraininggraph/compileoptimizer(_:).md)
- [compile(options:device:)](mlcompute/mlctraininggraph/compile(options:device:).md)
- [compile(options:device:inputTensors:inputTensorsData:)](mlcompute/mlctraininggraph/compile(options:device:inputtensors:inputtensorsdata:).md)
- [link(with:)](mlcompute/mlctraininggraph/link(with:).md)
- [allocateUserGradient(for:)](mlcompute/mlctraininggraph/allocateusergradient(for:).md)
- [MLCGraphCompilationOptions](mlcompute/mlcgraphcompilationoptions.md)
