SKaiNET

object SKaiNET(source)

Primary Java entry point for SKaiNET tensor operations.

Provides static factory methods for creating execution contexts, tensors, and performing common operations without requiring Kotlin-specific knowledge.

Example usage from Java:

var ctx = SKaiNET.context();
var a = SKaiNET.tensor(ctx, new int[]{2, 3}, DType.fp32(), new float[]{1,2,3,4,5,6});
var b = SKaiNET.ones(ctx, new int[]{2, 3}, DType.fp32());
var c = TensorJavaOps.add(a, b);

Functions

Link copied to clipboard

Creates a new CPU execution context with default settings (eval mode).

Link copied to clipboard
fun full(ctx: ExecutionContext, shape: IntArray, dtype: DType, value: Number): Tensor<*, *>

Creates a tensor filled with a constant value.

Link copied to clipboard
fun ones(ctx: ExecutionContext, shape: IntArray, dtype: DType = FP32): Tensor<*, *>

Creates a tensor filled with ones.

Link copied to clipboard
fun randn(ctx: ExecutionContext, shape: IntArray, dtype: DType = FP32): Tensor<*, *>

Creates a tensor filled with random values from a normal distribution.

Link copied to clipboard
fun tensor(ctx: ExecutionContext, shape: IntArray, dtype: DType, data: FloatArray): Tensor<*, *>

Creates a tensor from a float array with the given shape and dtype.

Link copied to clipboard
fun tensorFromInts(ctx: ExecutionContext, shape: IntArray, dtype: DType, data: IntArray): Tensor<*, *>

Creates a tensor from an int array with the given shape and dtype.

Link copied to clipboard
fun zeros(ctx: ExecutionContext, shape: IntArray, dtype: DType = FP32): Tensor<*, *>

Creates a tensor filled with zeros.