Package ai.djl.nn
Class AbstractSymbolBlock
java.lang.Object
ai.djl.nn.AbstractBaseBlock
ai.djl.nn.AbstractSymbolBlock
- All Implemented Interfaces:
Block,SymbolBlock
AbstractSymbolBlock is an abstract implementation of SymbolBlock.-
Field Summary
Fields inherited from class ai.djl.nn.AbstractBaseBlock
inputNames, inputShapes, outputDataTypes, version -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newAbstractSymbolBlockinstance.AbstractSymbolBlock(byte version) Builds an empty block with the given version for parameter serialization. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all the children of the block.Shape[]getOutputShapes(Shape[] inputShapes) Returns the expected output shapes of the block for the specified input shapes.Methods inherited from class ai.djl.nn.AbstractBaseBlock
beforeInitialize, cast, clear, describeInput, forward, forward, forwardInternal, forwardInternal, getInputShapes, getOutputDataTypes, getParameters, initialize, initializeChildBlocks, isInitialized, loadMetadata, loadParameters, prepare, readInputShapes, saveInputShapes, saveMetadata, saveParameters, setInitializer, setInitializer, setInitializer, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.djl.nn.Block
cast, clear, describeInput, forward, forward, forward, freezeParameters, freezeParameters, getCustomMetadata, getDirectParameters, getInputShapes, getOutputDataTypes, getOutputShapes, getParameters, initialize, isInitialized, loadParameters, saveParameters, setInitializer, setInitializer, setInitializerMethods inherited from interface ai.djl.nn.SymbolBlock
describeOutput, removeLastBlock
-
Constructor Details
-
AbstractSymbolBlock
public AbstractSymbolBlock()Constructs a newAbstractSymbolBlockinstance. -
AbstractSymbolBlock
public AbstractSymbolBlock(byte version) Builds an empty block with the given version for parameter serialization.- Parameters:
version- the version to use for parameter serialization.
-
-
Method Details
-
getOutputShapes
Returns the expected output shapes of the block for the specified input shapes.- Specified by:
getOutputShapesin interfaceBlock- Parameters:
inputShapes- the shapes of the inputs- Returns:
- the expected output shapes of the block
-
getChildren
Returns a list of all the children of the block.- Specified by:
getChildrenin interfaceBlock- Returns:
- the list of child blocks
-