Package ai.djl.nn
Class Parameter.Builder
java.lang.Object
ai.djl.nn.Parameter.Builder
- Enclosing class:
- Parameter
A Builder to construct a
Parameter
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aParameter
instance.Sets the array of theParameter
.optInitializer
(Initializer initializer) Sets the Initializer of theParameter
.optRequiresGrad
(boolean requiresGrad) Sets if theParameter
requires gradient.Sets the shape of theParameter
.Sets the name of theParameter
.setType
(Parameter.Type type) Sets theType
of theParameter
.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setName
Sets the name of theParameter
.- Parameters:
name
- the name of theParameter
- Returns:
- this
Parameter
-
setType
Sets theType
of theParameter
.- Parameters:
type
- theType
of theParameter
- Returns:
- this
Parameter
-
optShape
Sets the shape of theParameter
.- Parameters:
shape
- the shape of theParameter
- Returns:
- this
Parameter
-
optInitializer
Sets the Initializer of theParameter
.- Parameters:
initializer
- the Initializer of theParameter
- Returns:
- this
Parameter
-
optArray
Sets the array of theParameter
.- Parameters:
array
- the array of theParameter
- Returns:
- this
Parameter
-
optRequiresGrad
Sets if theParameter
requires gradient.- Parameters:
requiresGrad
- if theParameter
requires gradient- Returns:
- this
Parameter
-
build
Builds aParameter
instance.- Returns:
- the
Parameter
instance
-