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

# identity(with:name:)

Copies the input tensor values into the output, behaving as an identity operation.

## Declaration

```swift
func identity(with tensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `name`: An optional string which serves as an identifier for the operation.

## Return Value

Return Value A valid MPSGraphTensor object which is a copy of the input.
