CustomValidationConfig.Builder

public static classCustomValidationConfig.BuilderextendsObject

Builder class.

Public Constructor Summary

Builder()
Creates the custom validation config builder.

Public Method Summary

CustomValidationConfig
build()
Returns the CustomValidationConfigresult.
CustomValidationConfig.Builder
CustomValidationConfig.Builder
setBatchSize(int value)
Sets the number of batches of the golden input.
CustomValidationConfig.Builder
setGoldenConfig(AccelerationConfig value)
Sets the AccelerationConfigused to calculate golden output if the CustomValidationConfig.goldenOutputs()is not provided.
CustomValidationConfig.Builder
setGoldenInputs(Object...value)
Sets the golden input of validation test.
CustomValidationConfig.Builder
setGoldenOutputs(ByteBuffer... value)
Sets the golden output used for accuracy validation.
CustomValidationConfig.Builder
setInferenceTimeoutMillis(long value)
Sets the time out setting for a validation test.

Inherited Method Summary

Public Constructors

publicBuilder()

Creates the custom validation config builder.

Public Methods

public CustomValidationConfig.BuildersetAccuracyValidator(CustomValidationConfig.AccuracyValidator value)

Sets the CustomValidationConfig.AccuracyValidatorto decide whether aBenchmarkResult passes accuracy check. If accuracy validation is not needed, set this field to CustomValidationConfig.SKIP_VALIDATION.Default value is set to CustomValidationConfig.BYTE_MATCHING_VALIDATOR.

public CustomValidationConfig.BuildersetBatchSize(int value)

Sets the number of batches of the golden input. Set to 1 by default.

public CustomValidationConfig.BuildersetGoldenConfig(AccelerationConfig value)

Sets the AccelerationConfigused to calculate golden output if the CustomValidationConfig.goldenOutputs()is not provided. By default it is set to CustomValidationConfig.DEFAULT_GOLDEN_CONFIG.If accuracy validation is not needed, set this field tonull.

public CustomValidationConfig.BuildersetGoldenInputs(Object...value)

Sets the golden input of validation test. Thevalueshould be in the same order as inputs of the model. When more than one batch input is provided, the same input from different batches needs to be concatenated as one of the allowed input type. Eachvaluecan be an array or multidimensional rectangular array, or a Bufferof primitive types including int, float, long, and byte, or null. WhenBufferis used, its content should remain unchanged until the build()is done, and the caller must ensure that theBufferis at the appropriate read position. Boolean and String tensor type is not supported.

public CustomValidationConfig.BuildersetGoldenOutputs(ByteBuffer... value)

Sets the golden output used for accuracy validation. It will be passed to CustomValidationConfig.AccuracyValidator.validate(BenchmarkResult, ByteBuffer[])when verifying actual and golden output. If this is not provided, we will use CustomValidationConfig.goldenConfig()to calculate the golden output first.

public CustomValidationConfig.BuildersetInferenceTimeoutMillis(long value)

Sets the time out setting for a validation test.