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

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

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

# eye

[common]\
fun [eye](eye.md)(n: [Tensor](../Tensor/index.md), m: [Tensor](../Tensor/index.md)? = null, dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`eye(n: Tensor, m: Tensor? = null, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `eye` operator. A 2-D identity matrix `[n, m]`: `1` on the diagonal, `0` elsewhere; `m` defaults to `n` (square).

[common]\
fun [eye](eye.md)(n: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), m: [Tensor](../Tensor/index.md)? = null, dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`eye(n: Double, m: Tensor? = null, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the number form of `eye`, `n` as a scalar.