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

# reverse(_:axes:name:)

Creates a reverse operation and returns the result tensor.

## Declaration

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

## Parameters

- `tensor`: The tensor to be reversed.
- `axes`: A tensor that specifies axes to be reversed (Axes must be unique and within normal axis range).
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.

## Discussion

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