---
title: "argumentCount(forFunction:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/context/argumentcount(forfunction:)"
---

# argumentCount(forFunction:)

Returns the number of arguments for the given function argument.

## Declaration

```swift
func argumentCount(forFunction function: String? = nil) -> Int
```

## Parameters

- `function`: The function. Specify as nil if the graph only contains one function.

## See Also

### Related Documentation

- [BNNSGraphGetArgumentCount(_:_:)](accelerate/bnnsgraphgetargumentcount(_:_:).md)

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

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