---
title: "sliceGradientTensor(_:fwdInShapeTensor:starts:ends:strides:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/slicegradienttensor(_:fwdinshapetensor:starts:ends:strides:name:)"
---

# sliceGradientTensor(_:fwdInShapeTensor:starts:ends:strides:name:)

Creates a strided-slice gradient operation and returns the result tensor.

## Declaration

```swift
func sliceGradientTensor(_ inputGradientTensor: MPSGraphTensor, fwdInShapeTensor: MPSGraphTensor, starts: [NSNumber], ends: [NSNumber], strides: [NSNumber], name: String?) -> MPSGraphTensor
```

## Parameters

- `inputGradientTensor`: The input gradient.
- `fwdInShapeTensor`: The shape of the forward pass input, that is the shape of the gradient output.
- `starts`: An array of numbers that specify the starting points for each dimension.
- `ends`: An array of numbers that specify the ending points for each dimension.
- `strides`: An array of numbers that specify the strides for each dimension.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object
