ChainedTransform

class ChainedTransform<I, M, O>(first: Transform<I, M>, second: Transform<M, O>) : Transform<I, O> (source)

A transform that chains two transforms together, applying them in sequence.

This class is the implementation detail behind the Transform.then operator. It maintains full type safety by using intermediate type M to connect the first transform's output to the second transform's input.

Parameters

I

The input type of the first transform

M

The intermediate type (output of first, input of second)

O

The output type of the second transform

first

The first transform to apply

second

The transform to apply to the first transform's output

Constructors

Link copied to clipboard
constructor(first: Transform<I, M>, second: Transform<M, O>)

Functions

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

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