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.Object
A Builder to construct aParameter
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Parameter
build()
Builds aParameter
instance.Parameter.Builder
optArray(NDArray array)
Sets the array of theParameter
.Parameter.Builder
optInitializer(Initializer initializer)
Sets the Initializer of theParameter
.Parameter.Builder
optRequiresGrad(boolean requiresGrad)
Sets if theParameter
requires gradient.Parameter.Builder
optShape(Shape shape)
Sets the shape of theParameter
.Parameter.Builder
setName(java.lang.String name)
Sets the name of theParameter
.Parameter.Builder
setType(Parameter.Type type)
Sets theType
of 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 theType
of theParameter
.- Parameters:
type
- theType
of 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 theParameter
requires gradient.- Parameters:
requiresGrad
- if theParameter
requires gradient- Returns:
- this
Parameter
-
build
public Parameter build()
Builds aParameter
instance.- Returns:
- the
Parameter
instance
-
-