---
title: "init(_:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Initializer
path: "metalperformanceshadersgraph/mpsgraphtensordata/init(_:)-511a"
---

# init(_:)

Initializes a tensor data with an MPS image batch.

## Declaration

```swift
init(_ imageBatch: [MPSImage])
```

## Parameters

- `imageBatch`: The device on which the kernel will run, unorm8 and unorm16 images will create a float32 tensorData

## Return Value

Return Value A valid MPSGraphTensorData, or nil if allocation failure.

## Discussion

Discussion The dataLayout used will be NHWC, call a transpose or permute to change to a layout of your choice.
