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

# tensorSizeAndAlign(descriptor:)

Determines the size and alignment required to hold the data of a tensor you create with a descriptor in a buffer.

## Declaration

```swift
func tensorSizeAndAlign(descriptor: MTLTensorDescriptor) -> MTLSizeAndAlign
```

## Parameters

- `descriptor`: A description of the properties for the new tensor.

## Return Value

Return Value The size and alignment required to hold the data of a tensor you create with descriptor in a buffer.
