Identity

class Identity<T> : Transform<T, T> (source)

An identity transform that returns its input unchanged.

This transform is useful as a starting point for building pipelines and as a no-op placeholder when a transform is required but no actual transformation is needed.

Example:

// Start a pipeline with identity
val pipeline = pipeline<Image>()
.resize(224, 224)
.toTensor()
.normalize(mean, std)

Parameters

T

The type that passes through unchanged

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun apply(input: T): T

Applies this transformation to the given input.

Link copied to clipboard
open override fun getOutputShape(inputShape: Shape): Shape

Computes the output shape that would result from applying this transform to data with the given input shape.

Link copied to clipboard
open override fun toString(): String