<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.4.0",
    "iPadOS: 14.0.0 - 17.4.0",
    "macCatalyst: 14.0.0 - 17.4.0",
    "macOS: 11.0.0 - 14.3.0",
    "tvOS: 14.0.0 - 17.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCPaddingLayer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ML Compute"
    ],
    "preciseIdentifier" : "c:objc(cs)MLCPaddingLayer"
  },
  "title" : "MLCPaddingLayer"
}
-->

# MLCPaddingLayer

A layer that pads a tensor with the padding sizes you specify.

```
class MLCPaddingLayer
```

## Topics

### Creating Padding Layers

[`init(reflectionPadding:)`](/documentation/MLCompute/MLCPaddingLayer/init(reflectionPadding:))

Creates a padding layer with the reflection padding sizes you specify.

[`init(symmetricPadding:)`](/documentation/MLCompute/MLCPaddingLayer/init(symmetricPadding:))

Creates a padding layer with the symmetric padding sizes you specify.

[`init(zeroPadding:)`](/documentation/MLCompute/MLCPaddingLayer/init(zeroPadding:))

Creates a padding layer with the zero padding sizes you specify.

[`init(constantPadding:constantValue:)`](/documentation/MLCompute/MLCPaddingLayer/init(constantPadding:constantValue:))

Creates a padding layer with the constant padding sizes and constant value you specify.

[`layerWithReflectionPadding:`](/documentation/MLCompute/MLCPaddingLayer/layerWithReflectionPadding:)

Creates a padding layer with the reflection padding sizes you specify.

[`layerWithSymmetricPadding:`](/documentation/MLCompute/MLCPaddingLayer/layerWithSymmetricPadding:)

Creates a padding layer with the symmetric padding sizes you specify.

[`layerWithZeroPadding:`](/documentation/MLCompute/MLCPaddingLayer/layerWithZeroPadding:)

Creates a padding layer with the zero padding sizes you specify.

[`layerWithConstantPadding:constantValue:`](/documentation/MLCompute/MLCPaddingLayer/layerWithConstantPadding:constantValue:)

Creates a padding layer with the constant padding sizes and constant valu you specify.

### Inspecting Padding Layers

[`paddingType`](/documentation/MLCompute/MLCPaddingLayer/paddingType)

The padding type.

[`paddingLeft`](/documentation/MLCompute/MLCPaddingLayer/paddingLeft)

The left padding size.

[`paddingRight`](/documentation/MLCompute/MLCPaddingLayer/paddingRight)

The right padding size.

[`paddingTop`](/documentation/MLCompute/MLCPaddingLayer/paddingTop)

The top padding size.

[`paddingBottom`](/documentation/MLCompute/MLCPaddingLayer/paddingBottom)

The bottom padding size.

[`constantValue`](/documentation/MLCompute/MLCPaddingLayer/constantValue)

The constant value you use if padding type is constant.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)