transforms

inline fun <T : DType, V, R> transforms(ctx: ExecutionContext, block: TransformScope<T, V>.() -> R): R(source)

Creates a transform scope with the given execution context.

Usage:

val preprocessing = transforms(ctx) {
pipeline<Tensor<FP32, Float>>()
.rescale(255f)
.normalize(ImageNet.mean, ImageNet.std)
}

Return

The transform created within the scope

Parameters

ctx

The execution context to use for all transforms

block

The builder block that creates the transform pipeline