---
title: "buffer(for:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtltensorbufferattachments/buffer(for:)"
---

# buffer(for:)

Returns the buffer backing the given plane, or nil if none has been set.

## Declaration

```swift
func buffer(for plane: MTLTensorPlaneType) -> (any MTLBuffer)?
```

## Parameters

- `plane`: The plane type to look up.

## Return Value

Return Value The buffer for the given plane, or nil.
