tfx_bsl.public.beam.run_inference.RunInferencePerModel
Stay organized with collections
Save and categorize content based on your preferences.
Vectorized variant of RunInference (useful for ensembles).
tfx_bsl.public.beam.run_inference.RunInferencePerModel(
inference_spec_types: Iterable[tfx_bsl.public.proto.model_spec_pb2.InferenceSpecType
],
load_override_fn: Optional[run_inference.LoadOverrideFnType] = None
) -> beam.pvalue.PCollection
Args |
examples
|
A PCollection containing examples of the following possible kinds,
each with their corresponding return type.
PCollection[Example] -> PCollection[
Tuple[PredictionLog, ...]]
- Works with Classify, Regress, MultiInference, Predict and
RemotePredict.
PCollection[SequenceExample] -> PCollection[
Tuple[PredictionLog, ...]]
- Works with Predict and (serialized) RemotePredict.
PCollection[bytes] -> PCollection[
Tuple[PredictionLog, ...]]
- For serialized Example: Works with Classify, Regress,
MultiInference, Predict and RemotePredict.
- For everything else: Works with Predict and RemotePredict.
PCollection[Tuple[K, Example]] -> PCollection[
Tuple[K,
Tuple[PredictionLog,
...]]]
- Works with Classify, Regress, MultiInference, Predict and
RemotePredict.
PCollection[Tuple[K, SequenceExample]] -> PCollection[
Tuple[K,
Tuple[PredictionLog,
...]]]
- Works with Predict and (serialized) RemotePredict.
PCollection[Tuple[K, bytes]] -> PCollection[
Tuple[K,
Tuple[PredictionLog,
...]]]
- For serialized Example: Works with Classify, Regress,
MultiInference, Predict and RemotePredict.
- For everything else: Works with Predict and RemotePredict.
|
inference_spec_types
|
A flat iterable of Model inference endpoints.
Inference will happen in a fused fashion (ie without data
materialization), sequentially across Models within a Beam thread (but
in parallel across threads and workers).
|
load_override_fn
|
Optional function taking a model path and sequence of
tags, and returning a tf SavedModel. The loaded model must be equivalent
in interface to the model that would otherwise be loaded. It is up to the
caller to ensure compatibility. This argument is experimental and subject
to change.
|
Returns |
A PCollection (possibly keyed) containing a Tuple of prediction logs. The
Tuple of prediction logs is 1-1 aligned with inference_spec_types.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-03 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"lastModified": "Last updated 2024-05-03 UTC.",
"confidential": False
}