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

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

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

# linspace

[common]\
fun [linspace](linspace.md)(start: [Tensor](../Tensor/index.md), end: [Tensor](../Tensor/index.md), steps: [Tensor](../Tensor/index.md), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`linspace(start: Tensor, end: Tensor, steps: Tensor, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `linspace` operator. `steps` evenly spaced values from `start` to `end`, ENDPOINTS INCLUDED. `out[i] = start + i * (end - start) / (steps - 1)`; the last element is exactly `end`; `steps = 1` yields just `start`. Contrast `arange`, whose upper bound is exclusive. Bounds and count are literals or 0-D Tensors (trace symbolically).

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

`linspace(start: Double, end: Double, steps: Double, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the number form of `linspace`, `start`, `end`, `steps` as scalars.