estimator
estimator copied to clipboard
copy of input_receiver.features
deepcopy of input_receiver.features avoid changing input_receiver.features in model_fn
Thanks for the PR!
I think this counts as a shallow copy, since the values aren't being copied before being added to the new dict. You could replace the loop and use: copy.copy(input_receiver.features)
Also, is there an issue associated with this change? Typically, the input_receiver_fn
produces a new features dict that isn't used anywhere else, which is why modifications to it would be generally acceptable. (but for code cleanliness, I agree that making a copy before passing it to the model function is better).
@k-w-w thanks for your reply, We encountered this problem because the incoming features were modified in model_fn, so, the placeholder
which in savdemodel is not matched the input_receiver_fn
.
I will change the PR and use copy.copy(input_receiver.features)
.
Hi @k-w-w Can you please review this PR ? Thank you!
No more updates to Estimator, except to ensure compat with TF releases, when needed