Package ai.djl.nn

Interface BlockFactory

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    IdentityBlockFactory

    public interface BlockFactory
    extends java.io.Serializable
    Block factory is a component to make standard for block creating and saving procedure. Block factory design is intended to bypass the serialization of the blocks. This class can be used by ModelZoo or DJL Serving to recover the block to its uninitialized states. User should combine this method with the block.loadParameter to get the block with all parameters.
    • Method Detail

      • newBlock

        Block newBlock​(Model model,
                       java.nio.file.Path modelPath,
                       java.util.Map<java.lang.String,​?> arguments)
                throws java.io.IOException
        Constructs the uninitialized block.
        Parameters:
        model - the model of the block
        modelPath - the directory of the model location
        arguments - the block creation arguments
        Returns:
        the uninitialized block
        Throws:
        java.io.IOException - if IO operation fails during creating block