Skip to content

Commit

Permalink
noop
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 311437702
  • Loading branch information
mdreves authored and tf-model-analysis-team committed May 14, 2020
1 parent c310eb1 commit 42bb702
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tensorflow_model_analysis/api/model_eval_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +754,15 @@ def default_writers(


@beam.ptransform_fn
@beam.typehints.with_input_types(Union[bytes, types.Extracts])
# TODO(b/156538355): Find out why str is also required instead of just bytes
# after adding types.Extracts.
@beam.typehints.with_input_types(Union[bytes, str, types.Extracts])
@beam.typehints.with_output_types(types.Extracts)
def InputsToExtracts( # pylint: disable=invalid-name
inputs: beam.pvalue.PCollection):
"""Converts serialized inputs (e.g. examples) to Extracts if not already."""

def to_extracts(x: Union[bytes, types.Extracts]) -> types.Extracts:
def to_extracts(x: Union[bytes, str, types.Extracts]) -> types.Extracts:
result = {}
if isinstance(x, dict):
result.update(x)
Expand Down

0 comments on commit 42bb702

Please sign in to comment.