Skip to content

Commit

Permalink
Fix oss unit tests in Python 3.9 for recent changes.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 646231811
  • Loading branch information
Google AI Edge authored and copybara-github committed Jun 24, 2024
1 parent a104fa6 commit 8e8d31b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ai_edge_quantizer/model_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from collections.abc import Callable, Iterable
import json
import math
from typing import Any, Union
from typing import Any, Optional, Union

import numpy as np

Expand All @@ -17,7 +17,7 @@ def compare_model(
target_model: Union[str, bytearray],
signature_dataset: Iterable[dict[str, Any]],
compare_fn: Callable[[Any, Any], float],
signature_key: str | None = None,
signature_key: Optional[str] = None,
quantize_target_input: bool = True,
) -> dict[str, float]:
"""Compares model tensors over a model signature using the compare_fn.
Expand Down
4 changes: 2 additions & 2 deletions ai_edge_quantizer/utils/tfl_interpreter_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Util functions for TFL interpreter."""

from typing import Any, Union
from typing import Any, Optional, Union

import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -51,7 +51,7 @@ def _is_tensor_quantized(tensor_detail: dict[str, Any]) -> bool:
def invoke_interpreter_signature(
tflite_interpreter: tf.lite.Interpreter,
signature_input_data: dict[str, Any],
signature_key: str | None = None,
signature_key: Optional[str] = None,
quantize_input: bool = True,
) -> dict[str, np.ndarray]:
"""Invokes the TFLite interpreter through signature runner.
Expand Down

0 comments on commit 8e8d31b

Please sign in to comment.