---
title: MLCSliceLayer
framework: ML Compute
role: symbol
role_heading: Class
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: mlcompute/mlcslicelayer
---

# MLCSliceLayer

A layer that extracts a slice from a tensor.

## Declaration

```swift
class MLCSliceLayer
```

## Overview

Overview The framework supports positive stride. Use a slice layer to slice a given source. Slicing won’t decrease the tensor dimension. The start, end, and stride vectors must be of the same size, equal to the source tensor dimension.

## Topics

### Creating Slice Layers

- [init(start:end:stride:)](mlcompute/mlcslicelayer/init(start:end:stride:).md)

### Inspecting Slice Layers

- [start](mlcompute/mlcslicelayer/start-6wsh6.md)
- [end](mlcompute/mlcslicelayer/end-9xw91.md)
- [stride](mlcompute/mlcslicelayer/stride-84fhb.md)

## Relationships

### Inherits From

- [MLCLayer](mlcompute/mlclayer.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Transformation Layers

- [MLCTransposeLayer](mlcompute/mlctransposelayer.md)
- [MLCConcatenationLayer](mlcompute/mlcconcatenationlayer.md)
- [MLCReshapeLayer](mlcompute/mlcreshapelayer.md)
- [MLCSplitLayer](mlcompute/mlcsplitlayer.md)
- [MLCPaddingLayer](mlcompute/mlcpaddinglayer.md)
- [MLCScatterLayer](mlcompute/mlcscatterlayer.md)
- [MLCSelectionLayer](mlcompute/mlcselectionlayer.md)
- [MLCGatherLayer](mlcompute/mlcgatherlayer.md)
