---
title: "argumentPosition(forFunction:argument:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/context/argumentposition(forfunction:argument:)"
---

# argumentPosition(forFunction:argument:)

Returns the index into the arguments array for the given function argument.

## Declaration

```swift
func argumentPosition(forFunction function: String? = nil, argument: String) -> Int
```

## Parameters

- `function`: The function. Specify as nil if the graph only contains one function.
- `argument`: The name of the input or output argument.

## See Also

### Related Documentation

- [BNNSGraphGetArgumentPosition(_:_:_:)](accelerate/bnnsgraphgetargumentposition(_:_:_:).md)

### Specifying and querying a graph context’s properties

- [setDynamicShapes(_:forFunction:)](accelerate/bnnsgraph/context/setdynamicshapes(_:forfunction:).md)
- [BNNSGraph.Shape](accelerate/bnnsgraph/shape.md)
- [argumentCount(forFunction:)](accelerate/bnnsgraph/context/argumentcount(forfunction:).md)
- [argumentNames(forFunction:)](accelerate/bnnsgraph/context/argumentnames(forfunction:).md)
- [functionCount](accelerate/bnnsgraph/context/functioncount.md)
- [functionNames](accelerate/bnnsgraph/context/functionnames.md)
- [checkForNaNsAndInfinities](accelerate/bnnsgraph/context/checkfornansandinfinities.md)
