Package ai.djl.nn
Class AbstractSymbolBlock
- java.lang.Object
-
- ai.djl.nn.AbstractBaseBlock
-
- ai.djl.nn.AbstractSymbolBlock
-
- All Implemented Interfaces:
Block
,SymbolBlock
public abstract class AbstractSymbolBlock extends AbstractBaseBlock implements SymbolBlock
AbstractSymbolBlock
is an abstract implementation ofSymbolBlock
.
-
-
Field Summary
-
Fields inherited from class ai.djl.nn.AbstractBaseBlock
inputNames, inputShapes, version
-
-
Constructor Summary
Constructors Constructor Description AbstractSymbolBlock()
Constructs a newAbstractSymbolBlock
instance.AbstractSymbolBlock(byte version)
Builds an empty block with the given version for parameter serialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockList
getChildren()
Returns 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, getParameters, initialize, initializeChildBlocks, isInitialized, loadMetadata, loadParameters, prepare, readInputShapes, saveInputShapes, saveMetadata, saveParameters, setInitializer, setInitializer, setInitializer, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ai.djl.nn.Block
cast, clear, describeInput, forward, forward, forward, freezeParameters, getDirectParameters, getInputShapes, getParameters, initialize, isInitialized, loadParameters, saveParameters, setInitializer, setInitializer, setInitializer
-
Methods inherited from interface ai.djl.nn.SymbolBlock
describeOutput, removeLastBlock
-
-
-
-
Constructor Detail
-
AbstractSymbolBlock
public AbstractSymbolBlock()
Constructs a newAbstractSymbolBlock
instance.
-
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 Detail
-
getOutputShapes
public Shape[] getOutputShapes(Shape[] inputShapes)
Returns the expected output shapes of the block for the specified input shapes.- Specified by:
getOutputShapes
in interfaceBlock
- Parameters:
inputShapes
- the shapes of the inputs- Returns:
- the expected output shapes of the block
-
getChildren
public BlockList getChildren()
Returns a list of all the children of the block.- Specified by:
getChildren
in interfaceBlock
- Returns:
- the list of child blocks
-
-