Skip to content

Commit

Permalink
Replace inspect with tf_inspect (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-c authored Feb 25, 2024
1 parent 4f3c1f9 commit 6d05a52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions model_compression_toolkit/core/keras/reader/node_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# limitations under the License.
# ==============================================================================
from typing import Any, Callable, Dict
import inspect

import tensorflow as tf
from tensorflow.python.util import tf_inspect

import numpy as np
from packaging import version

Expand Down Expand Up @@ -56,8 +57,7 @@ def get_kwargs2index(tf_func: Callable) -> Dict[str, int]:
"""
if tf_func in [tf.add, tf.subtract, tf.divide, tf.truediv, tf.multiply, tf.pow,
tf.matmul, tf.image.crop_and_resize, tf.image.combined_non_max_suppression]:
# We utilized tf_func.__wrapped__ to circumvent compatibility issues with different versions of TensorFlow.
return {arg_name: i for i, arg_name in enumerate(inspect.getfullargspec(tf_func.__wrapped__).args)}
return {arg_name: i for i, arg_name in enumerate(tf_inspect.getfullargspec(tf_func).args)}
else:
return {}

Expand Down

0 comments on commit 6d05a52

Please sign in to comment.