---
title: MLCSelectionLayer
framework: ML Compute
role: symbol
role_heading: Class
platforms: [iOS 14.5+, iPadOS 14.5+, Mac Catalyst 14.5+, macOS 11.3+, tvOS 14.5+]
path: mlcompute/mlcselectionlayer
---

# MLCSelectionLayer

A layer for selecting elements from two tensors.

## Declaration

```swift
class MLCSelectionLayer
```

## Overview

Overview A selection layer takes a condition tensor that acts as a mask. It determines whether the corresponding element or row in the output comes from tensor X (if the element in the condition is true) or tensor Y (if false).

## Topics

### Creating Selection Layers

- [init()](mlcompute/mlcselectionlayer/init().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)
- [MLCSliceLayer](mlcompute/mlcslicelayer.md)
- [MLCSplitLayer](mlcompute/mlcsplitlayer.md)
- [MLCPaddingLayer](mlcompute/mlcpaddinglayer.md)
- [MLCScatterLayer](mlcompute/mlcscatterlayer.md)
- [MLCGatherLayer](mlcompute/mlcgatherlayer.md)
