2020from __future__ import print_function
2121
2222import copy
23- import inspect
2423import json
2524import os
2625import re
3534from tensorflow .contrib .keras .python .keras .utils .io_utils import ask_to_proceed_with_overwrite
3635from tensorflow .contrib .keras .python .keras .utils .layer_utils import print_summary as print_layer_summary
3736from tensorflow .python .framework import tensor_shape
37+ from tensorflow .python .util import tf_inspect
3838
3939
4040# pylint: disable=g-import-not-at-top
@@ -584,7 +584,7 @@ def __call__(self, inputs, **kwargs):
584584 user_kwargs = copy .copy (kwargs )
585585 if not _is_all_none (previous_mask ):
586586 # The previous layer generated a mask.
587- if 'mask' in inspect .getargspec (self .call ).args :
587+ if 'mask' in tf_inspect .getargspec (self .call ).args :
588588 if 'mask' not in kwargs :
589589 # If mask is explicitly passed to __call__,
590590 # we should override the default mask.
@@ -2166,7 +2166,7 @@ def run_internal_graph(self, inputs, masks=None):
21662166 kwargs = {}
21672167 if len (computed_data ) == 1 :
21682168 computed_tensor , computed_mask = computed_data [0 ]
2169- if 'mask' in inspect .getargspec (layer .call ).args :
2169+ if 'mask' in tf_inspect .getargspec (layer .call ).args :
21702170 if 'mask' not in kwargs :
21712171 kwargs ['mask' ] = computed_mask
21722172 output_tensors = _to_list (layer .call (computed_tensor , ** kwargs ))
@@ -2177,7 +2177,7 @@ def run_internal_graph(self, inputs, masks=None):
21772177 else :
21782178 computed_tensors = [x [0 ] for x in computed_data ]
21792179 computed_masks = [x [1 ] for x in computed_data ]
2180- if 'mask' in inspect .getargspec (layer .call ).args :
2180+ if 'mask' in tf_inspect .getargspec (layer .call ).args :
21812181 if 'mask' not in kwargs :
21822182 kwargs ['mask' ] = computed_masks
21832183 output_tensors = _to_list (layer .call (computed_tensors , ** kwargs ))
0 commit comments