---
title: newAxis
framework: coreml
role: symbol
role_heading: Type Property
path: coreml/mltensorrangeexpression/newaxis
---

# newAxis

Expand the tensor at the specified dimension.

## Declaration

```swift
static var newAxis: any MLTensorRangeExpression { get }
```

## Discussion

Discussion For example: let x = MLTensor(randomNormal: [1, 3, 28, 28], scalarType: Float.self) let y = x[.newAxis, ...] y.shape // is [1, 1, 3, 28, 28]

## See Also

### Expanding and squeezing the tensor

- [squeezeAxis](coreml/mltensorrangeexpression/squeezeaxis.md)
- [fillAll](coreml/mltensorrangeexpression/fillall.md)
