---
title: "expandDims(_:axis:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/expanddims(_:axis:name:)"
---

# expandDims(_:axis:name:)

Creates an expand-dimensions operation and returns the result tensor.

## Declaration

```swift
func expandDims(_ tensor: MPSGraphTensor, axis: Int, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `axis`: The axis to expand.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.

## Discussion

Discussion Expands the tensor, inserting a dimension with size 1 at the specified axis.
