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

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

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

# mod

[common]\
fun [mod](mod.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)

`mod(input: Tensor, other: Tensor, mode: ModMode = ModMode.PYTHON)`: the `mod` operator. Elementwise modulo with a selectable sign convention. `ModMode::Python` (default) follows the DIVISOR's sign; `ModMode::C` follows the DIVIDEND's. `ops::remainder` is exactly the Python form, `ops::fmod` exactly the C form. Broadcasts and promotes as `add`.

[common]\
fun [mod](mod.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)

`mod(input: Tensor, other: Double, mode: ModMode = ModMode.PYTHON)`: the number form of `mod`, `other` as a scalar.