Package ai.djl.nn
Class Parameter.Builder
- java.lang.Object
-
- ai.djl.nn.Parameter.Builder
-
- Enclosing class:
- Parameter
public static final class Parameter.Builder extends java.lang.ObjectA Builder to construct aParameter.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Parameterbuild()Builds aParameterinstance.Parameter.BuilderoptArray(NDArray array)Sets the array of theParameter.Parameter.BuilderoptInitializer(Initializer initializer)Sets the Initializer of theParameter.Parameter.BuilderoptRequiresGrad(boolean requiresGrad)Sets if theParameterrequires gradient.Parameter.BuilderoptShape(Shape shape)Sets the shape of theParameter.Parameter.BuildersetName(java.lang.String name)Sets the name of theParameter.Parameter.BuildersetType(Parameter.Type type)Sets theTypeof theParameter.
-
-
-
Method Detail
-
setName
public Parameter.Builder setName(java.lang.String name)
Sets the name of theParameter.- Parameters:
name- the name of theParameter- Returns:
- this
Parameter
-
setType
public Parameter.Builder setType(Parameter.Type type)
Sets theTypeof theParameter.- Parameters:
type- theTypeof theParameter- Returns:
- this
Parameter
-
optShape
public Parameter.Builder optShape(Shape shape)
Sets the shape of theParameter.- Parameters:
shape- the shape of theParameter- Returns:
- this
Parameter
-
optInitializer
public Parameter.Builder optInitializer(Initializer initializer)
Sets the Initializer of theParameter.- Parameters:
initializer- the Initializer of theParameter- Returns:
- this
Parameter
-
optArray
public Parameter.Builder optArray(NDArray array)
Sets the array of theParameter.- Parameters:
array- the array of theParameter- Returns:
- this
Parameter
-
optRequiresGrad
public Parameter.Builder optRequiresGrad(boolean requiresGrad)
Sets if theParameterrequires gradient.- Parameters:
requiresGrad- if theParameterrequires gradient- Returns:
- this
Parameter
-
build
public Parameter build()
Builds aParameterinstance.- Returns:
- the
Parameterinstance
-
-