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

# init(_:)

Initializes an MPSGraphTensorData with an MTLTensor.

## Declaration

```swift
init(_ tensor: any MTLTensor)
```

## Parameters

- `tensor`: MTLTensor to be used within the MPSGraphTensorData

## Return Value

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

## Discussion

Discussion The internal storage of the MTLTensor will be aliased. Requires tensor to support MTLTensorUsageMachineLearning.
