---
title: "sliceTensor(_:start:sizeTensor:squeezeMask:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/slicetensor(_:start:sizetensor:squeezemask:name:)"
---

# sliceTensor(_:start:sizeTensor:squeezeMask:name:)

Creates a slice operation and returns the result tensor.

## Declaration

```swift
func sliceTensor(_ tensor: MPSGraphTensor, start startTensor: MPSGraphTensor, sizeTensor: MPSGraphTensor, squeezeMask: UInt32, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The Tensor to be sliced.
- `startTensor`: The tensor that specifies the starting points for each dimension.
- `sizeTensor`: The tensor that specifies the size of the result for each dimension.
- `squeezeMask`: A bitmask that indicates dimensions the operation will squeeze out from the result.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object.

## Discussion

Discussion Slices a tensor starting from startTensor, stopping short before startTensor + endTensor stepping a single pace between each value. Semantics based on TensorFlow Strided Slice Op.
