Skip to content

Commit 4bf69c0

Browse files
tf-model-analysis-teamtfx-copybara
tf-model-analysis-team
authored andcommitted
Use full to fill value all at once.
PiperOrigin-RevId: 518653495
1 parent b68b4da commit 4bf69c0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tensorflow_model_analysis/extractors/tflite_predict_extractor.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ def _batch_reducible_process(
111111
value = None
112112
if value is None or np.any(np.equal(value, None)):
113113
default = -1 if input_type in [np.float32, np.int64] else ''
114-
value = np.empty(input_shape)
115-
value.fill(default)
116-
value = value.astype(input_type)
114+
value = np.full(input_shape, default, dtype=input_type)
117115
logging.log_every_n(logging.WARNING,
118116
'Feature %s not found. Setting default value.',
119117
100, input_name)

0 commit comments

Comments
 (0)