allocateTensor(forFunction:argument:fillKnownDynamicShapes:)
Returns an allocated tensor for a given function argument.
Declaration
func allocateTensor(forFunction function: String? = nil, argument: String, fillKnownDynamicShapes: Bool) -> BNNSTensor?Parameters
- function:
The specific function to create the tensor for. You may set this to
nilif there is only one function. - argument:
The argument to create the tensor for.
- fillKnownDynamicShapes:
If
true, the function replaces any dynamic shapes with shapes that will be used on next execution ofContext, either drawn from default shapes in the.mlmodelcfunction or supplied by a preceding call tosetDynamicShapes(_:forFunction:)orsetBatchSize(_:forFunction:). Otherwise the function represents dynamically-sized dimensions with a value of-1in either shape or stride as appropriate.