Package ai.djl.nn.transformer
Class IdEmbedding.Builder
- java.lang.Object
-
- ai.djl.nn.transformer.IdEmbedding.Builder
-
- Enclosing class:
- IdEmbedding
public static final class IdEmbedding.Builder extends java.lang.ObjectThe Builder to construct anIdEmbeddingtype ofBlock.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdEmbeddingbuild()Builds theIdEmbedding.IdEmbedding.BuildersetDictionarySize(int dictionarySize)Sets the number of ids that should be embedded.IdEmbedding.BuildersetEmbeddingSize(int embeddingSize)Sets the size of the embeddings.
-
-
-
Method Detail
-
setDictionarySize
public IdEmbedding.Builder setDictionarySize(int dictionarySize)
Sets the number of ids that should be embedded. Valid ids are 0 to dictionarySize - 1.- Parameters:
dictionarySize- the number of ids that should be embedded. Valid ids are 0 to dictionarySize - 1.- Returns:
- this builder
-
setEmbeddingSize
public IdEmbedding.Builder setEmbeddingSize(int embeddingSize)
Sets the size of the embeddings.- Parameters:
embeddingSize- the size of the embeddings.- Returns:
- this builder
-
build
public IdEmbedding build()
Builds theIdEmbedding.- Returns:
- the constructed
IdEmbedding - Throws:
java.lang.IllegalArgumentException- if all required parameters (items, embeddingSize) have not been set
-
-