---
title: "cast(to:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/bnnsgraph/builder/tensor/cast(to:)"
---

# cast(to:)

Adds a cast operation to the current graph.

## Declaration

```swift
func cast<U>(to type: U.Type) -> BNNSGraph.Builder.Tensor<U> where U : BNNSScalar
```
