---
title: "read(_:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/read(_:name:)"
---

# read(_:name:)

Creates a read op which reads at this point of execution of the graph and returns the result tensor.

## Declaration

```swift
func read(_ variable: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `variable`: The variable resource tensor to read from.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.
