Package ai.djl.nn

Class Parameter.Builder

  • Enclosing class:
    Parameter

    public static final class Parameter.Builder
    extends java.lang.Object
    A Builder to construct a Parameter.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setName

        public Parameter.Builder setName​(java.lang.String name)
        Sets the name of the Parameter.
        Parameters:
        name - the name of the Parameter
        Returns:
        this Parameter
      • setType

        public Parameter.Builder setType​(Parameter.Type type)
        Sets the Type of the Parameter.
        Parameters:
        type - the Type of the Parameter
        Returns:
        this Parameter
      • optShape

        public Parameter.Builder optShape​(Shape shape)
        Sets the shape of the Parameter.
        Parameters:
        shape - the shape of the Parameter
        Returns:
        this Parameter
      • optInitializer

        public Parameter.Builder optInitializer​(Initializer initializer)
        Sets the Initializer of the Parameter.
        Parameters:
        initializer - the Initializer of the Parameter
        Returns:
        this Parameter
      • optArray

        public Parameter.Builder optArray​(NDArray array)
        Sets the array of the Parameter.
        Parameters:
        array - the array of the Parameter
        Returns:
        this Parameter
      • optRequiresGrad

        public Parameter.Builder optRequiresGrad​(boolean requiresGrad)
        Sets if the Parameter requires gradient.
        Parameters:
        requiresGrad - if the Parameter requires gradient
        Returns:
        this Parameter
      • build

        public Parameter build()
        Builds a Parameter instance.
        Returns:
        the Parameter instance