---
title: "pad"
sidebar_label: "pad"
description: "Kotlin binding reference: pad."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[pad](pad.md)

# pad

[common]\
fun [pad](pad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)

`pad(input: Tensor, pad: LongArray, mode: PadMode = PadMode.CONSTANT, value: Tensor? = null)`: the `pad` operator. Pad each axis by interleaved `(lo, hi)` pairs in layout order, left-to-right: pair `i` pads axis `i` (the first pair is the leading axis). Provide fewer pairs than the rank to pad only the leading axes; a negative width crops that side. `mode` selects the fill; `value` is the Constant fill (default 0).