class documentation

class InputConfig(OutputConfig):

View In Hierarchy

Tensor metadata and preprocessing for one model input.

Scalar mean and scale values are expanded to three channels. The named value "imagenet" expands to the standard ImageNet preprocessing vectors. One-channel inputs are normalized to grayscale encoding.

Instance Variable encoding Source and destination channel ordering.
Instance Variable frozen_value Constant value for an input that is not supplied at run time.
Instance Variable mean_values Per-channel value subtracted during preprocessing.
Instance Variable scale_values Per-channel divisor applied during preprocessing.
Property encoding_mismatch Undocumented
Property is_color_input Undocumented
Class Method _validate_encoding Undocumented
Static Method _parse_mean_values Parses the mean_values from the config.
Static Method _parse_scale_values Parses the scale_values from the config.
Static Method _parse_values Resolves named values from the config.
Method _validate_dynamic_batch_size Undocumented
Method _validate_grayscale_inputs Undocumented

Inherited from OutputConfig:

Method validate_layout Undocumented
Instance Variable data_type Tensor element type.
Instance Variable layout Dimension labels such as "NCHW". A default is inferred from shape when omitted.
Instance Variable name Tensor name in the source model.
Instance Variable shape Tensor dimensions. May be omitted when they can be inferred.
Class Method _make_default_layout Undocumented

Inherited from CustomBaseModel (via OutputConfig):

Class Variable model_config Undocumented
encoding: EncodingConfig =

Source and destination channel ordering.

frozen_value: Any | None =

Constant value for an input that is not supplied at run time.

mean_values: Annotated[list[float], Field(min_length=1)] | None =

Per-channel value subtracted during preprocessing.

scale_values: Annotated[list[float], Field(min_length=1)] | None =

Per-channel divisor applied during preprocessing.

@property
encoding_mismatch: bool =

Undocumented

@property
is_color_input: bool =

Undocumented

@model_validator(mode='before')
@classmethod
def _validate_encoding(cls, data: dict[str, Any]) -> dict[str, Any]:

Undocumented

@field_validator('mean_values', mode='before')
@staticmethod
def _parse_mean_values(value: Any) -> Any:

Parses the mean_values from the config.

@field_validator('scale_values', mode='before')
@staticmethod
def _parse_scale_values(value: Any) -> Any:

Parses the scale_values from the config.

@staticmethod
def _parse_values(values_type: Literal['mean', 'scale'], value: Any) -> Any:

Resolves named values from the config.

@model_validator(mode='after')
def _validate_dynamic_batch_size(self) -> Self:

Undocumented

@model_validator(mode='after')
def _validate_grayscale_inputs(self) -> Self:

Undocumented