Added in API level 35
Deprecated in API level 37

Builder


class Builder
kotlin.Any
   ↳ android.adservices.ondevicepersonalization.InferenceOutput.Builder

A builder for InferenceOutput

Summary

Public constructors

Public methods
InferenceOutput.Builder
addDataOutput(key: Int, value: Any)

InferenceOutput

Builds the instance.

InferenceOutput.Builder

A byte array that holds input data.

InferenceOutput.Builder

Note: use InferenceOutput.Builder.setData(byte[]) instead.

Public constructors

Builder

Added in API level 35
Builder()

Public methods

addDataOutput

Added in API level 35
fun addDataOutput(
    key: Int,
    value: Any
): InferenceOutput.Builder

Deprecated: Deprecated in Java.

Parameters
value Any: This value cannot be null.
Return
InferenceOutput.Builder This value cannot be null.

See Also

build

Added in API level 35
fun build(): InferenceOutput

Deprecated: Deprecated in Java.

Builds the instance. This builder should not be touched after calling this!

Return
InferenceOutput This value cannot be null.

setData

Added in API level 36.1
Deprecated in API level 37
fun setData(value: ByteArray): InferenceOutput.Builder

Deprecated: Deprecated in Java.

A byte array that holds input data. The inputs should be in the same order as inputs of the model.

For LiteRT, this field is a serialized Map that is mapped to outputs of runForMultipleInputsOutputs: https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/InterpreterApi#parameters_9

For ExecuTorch model, this field is a serialized EValue array.

Parameters
value ByteArray: This value cannot be null.
Return
InferenceOutput.Builder This value cannot be null.

setDataOutputs

Added in API level 35
fun setDataOutputs(value: MutableMap<Int!, Any!>): InferenceOutput.Builder

Deprecated: Deprecated in Java.

Note: use InferenceOutput.Builder.setData(byte[]) instead.

A map mapping output indices to multidimensional arrays of output.

For TFLite, this field is mapped to outputs of runForMultipleInputsOutputs: https://www.tensorflow.org/lite/api_docs/java/org/tensorflow/lite/InterpreterApi#parameters_9

Parameters
value MutableMap<Int!, Any!>: This value cannot be null.
Return
InferenceOutput.Builder This value cannot be null.