ones

fun ones(ctx: ExecutionContext, shape: IntArray, dtype: DType = FP32): Tensor<*, *>(source)

Creates a tensor filled with ones.

Return

A new tensor filled with ones.

Parameters

ctx

The execution context.

shape

The tensor dimensions.

dtype

The data type. Defaults to FP32.