setDynamicShapes(_:forFunction:)
Specifies the dynamic shapes for a graph and, if possible, infers the output shapes.
Declaration
func setDynamicShapes(_ shapes: [BNNSGraph.Shape], forFunction function: String? = nil) async throws -> [BNNSGraph.Shape]Parameters
- shapes:
An array of input shapes in the same order as you pass to Bnnsgraphcontextexecute(_:_:_:_:_:_:).
This function reads input shapes with a nonzero rank, and uses the constant or default value from the source model for input shapes with a zero rank. The function generates an error for shapes with a nonzero value that doesn’t match the source model.
- function:
The function. Specify as
nilif the graph only contains one function.