newAxis
Expand the tensor at the specified dimension.
Declaration
static var newAxis: any MLTensorRangeExpression { get }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]