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

# reverse(_:name:)

Creates a reverse operation and returns the result tensor.

## Declaration

```swift
func reverse(_ tensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The tensor to be reversed.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.

## Discussion

Discussion Reverses a tensor on all axes. Semantics based on TensorFlow reverse op.
