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

# tensor(forFunction:argument:fillKnownDynamicShapes:)

Returns an unallocated tensor for a given function argument.

## Declaration

```swift
func tensor(forFunction function: String? = nil, argument: String, fillKnownDynamicShapes: Bool) -> BNNSTensor?
```

## Parameters

- `function`: The function. Specify as nil if the graph only contains one function.
- `argument`: The name of the input or output argument.
- `fillKnownDynamicShapes`: A Boolean value that specifies whether the function should replace any dynamic shapes for the next execution of the context. BNNS derives these shapes either from the default shapes in the source model, or from preceding calls to doc://com.apple.accelerate/documentation/Accelerate/BNNSGraph/Context/setDynamicShapes(_:forFunction:) or /Accelerate/BNNSGraph/Context/setBatchSize(_:forFunction:). If BNNS is unable to derive the shapes, the function sets the dimensions to -1.

## See Also

### Related Documentation

- [BNNSGraphContextGetTensor(_:_:_:_:_:)](accelerate/bnnsgraphcontextgettensor(_:_:_:_:_:).md)
