Package ai.djl.nn

Class LambdaBlock

All Implemented Interfaces:
Block

public class LambdaBlock extends AbstractBlock
LambdaBlock is a Block with no parameters or children.

LambdaBlock allows converting any function that takes an NDList as input and returns an NDList into a parameter-less and child-less Block. This can be useful in converting activation functions, identity blocks, and more. For example, identity block can be created as new LambdaBlock(x -> x).