setBatchSize(_:forFunction:)
Sets the batch size for a graph.
Declaration
func setBatchSize(_ batchSize: Int, forFunction function: String? = nil) asyncParameters
- batchSize:
The batch size.
- function:
The specific function to set shapes for. You may set this to
nilif there is only one function.
Discussion
This is a special case of setDynamicShapes(_:forFunction:) where the only dynamic sizes that occur are the first index of their tensor (that is, the batch dimension) and are all equal. This allows just passing a single batchSize constant.
This function has no effect if you pass a batchSize value that’s less than zero.