Builder
classBuilder
| kotlin.Any | |
| ↳ | android.adservices.ondevicepersonalization.InferenceInput.Params.Builder |
A builder for Params
Summary
| Public constructors | |
|---|---|
Builder(keyValueStore: KeyValueStore, modelKey: String)Creates a new Builder. |
|
| Public methods | |
|---|---|
| InferenceInput.Params |
build()Builds the instance. |
| InferenceInput.Params.Builder |
setDelegateType(value: Int)The delegate to run model inference. |
| InferenceInput.Params.Builder |
setKeyValueStore(value: KeyValueStore)A |
| InferenceInput.Params.Builder |
setModelKey(value: String)The key of the table where the corresponding value stores a pre-trained model. |
| InferenceInput.Params.Builder |
setModelType(value: Int)The type of the pre-trained model. |
| InferenceInput.Params.Builder |
setRecommendedNumThreads(value: Int)The number of threads used for intraop parallelism on CPU, must be positive number. |
Public constructors
Builder
Builder(
keyValueStore: KeyValueStore,
modelKey: String)
Creates a new Builder.
| Parameters | |
|---|---|
keyValueStore |
KeyValueStore: a KeyValueStore where pre-trained model is stored. This value cannot be null. |
modelKey |
String: key of the table where the corresponding value stores a pre-trained model. This value cannot be null. |
Public methods
build
funbuild(): InferenceInput.Params
Deprecated: Deprecated in Java.
Builds the instance. This builder should not be touched after calling this!
| Return | |
|---|---|
InferenceInput.Params |
This value cannot be null. |
setDelegateType
funsetDelegateType(value: Int): InferenceInput.Params.Builder
Deprecated: Deprecated in Java.
The delegate to run model inference. If not set, the default value is DELEGATE_CPU.
| Parameters | |
|---|---|
value |
Int: Value is one of the following: |
| Return | |
|---|---|
InferenceInput.Params.Builder |
This value cannot be null. |
setKeyValueStore
funsetKeyValueStore(value: KeyValueStore): InferenceInput.Params.Builder
Deprecated: Deprecated in Java.
A KeyValueStore where pre-trained model is stored.
| Parameters | |
|---|---|
value |
KeyValueStore: This value cannot be null. |
| Return | |
|---|---|
InferenceInput.Params.Builder |
This value cannot be null. |
setModelKey
funsetModelKey(value: String): InferenceInput.Params.Builder
Deprecated: Deprecated in Java.
The key of the table where the corresponding value stores a pre-trained model.
| Parameters | |
|---|---|
value |
String: This value cannot be null. |
| Return | |
|---|---|
InferenceInput.Params.Builder |
This value cannot be null. |
setModelType
funsetModelType(value: Int): InferenceInput.Params.Builder
Deprecated: Deprecated in Java.
The type of the pre-trained model. If not set, the default value is MODEL_TYPE_TENSORFLOW_LITE .
| Parameters | |
|---|---|
value |
Int: Value is one of the following: |
| Return | |
|---|---|
InferenceInput.Params.Builder |
This value cannot be null. |
setRecommendedNumThreads
funsetRecommendedNumThreads(value: Int): InferenceInput.Params.Builder
Deprecated: Deprecated in Java.
The number of threads used for intraop parallelism on CPU, must be positive number. Adopters can set this field based on model architecture. The actual thread number depends on system resources and other constraints.
| Parameters | |
|---|---|
value |
Int: Value is 1 or greater |
| Return | |
|---|---|
InferenceInput.Params.Builder |
This value cannot be null. |