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

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

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

# div

[common]\
fun [div](div.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)

`div(input: Tensor, other: Tensor, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the `div` operator. Divides `input` by `other` elementwise, with an optional quotient rounding. Broadcasts and promotes as `add`.

[common]\
fun [div](div.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)

`div(input: Tensor, other: Double, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the number form of `div`, `other` as a scalar.

[common]\
fun [div](div.md)(input: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), other: [Tensor](../Tensor/index.md), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)

`div(input: Double, other: Tensor, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the `div` operator. Scalar-LHS `a / b`. `input` keeps its kind (see `Scalar`). The parameter set mirrors the tensor-first form: `rounding_mode` picks true/trunc/floor division, `activation` applies to the result.