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

# unsqueeze(axis:)

Adds an unsqueeze operation in the graph.

## Declaration

```swift
func unsqueeze(axis: Int) -> BNNSGraph.Builder.Tensor<T>
```

## Parameters

- `axis`: The axis at which the operation inserts the dimension.

## Discussion

Discussion This operation creates a dimension of size 1 at the given index, i.e. the output tensor will have the new dimension of size 1 at the given index.
