---
title: "makeTensor(descriptor:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/maketensor(descriptor:)"
---

# makeTensor(descriptor:)

Creates a tensor with the specified descriptor.

## Declaration

```swift
func makeTensor(descriptor: MTLTensorDescriptor) throws -> any MTLTensor
```

## Parameters

- `descriptor`: The tensor descriptor configuring the data plane and auxiliary planes.

## Return Value

Return Value A tensor, or nil if validation fails.

## Discussion

Discussion This method validates the constraints documented on MTLTensorDescriptor.
