Run the variable initializer without autograph to avoid the loop unroll warning for models with a very large number of variables.

PiperOrigin-RevId: 293279240
Change-Id: If926a898edaa25ae692dd01c90441ff308741b6f
This commit is contained in:
Dan Moldovan 2020-02-04 19:13:55 -08:00 committed by TensorFlower Gardener
parent a57f2749f2
commit 645b10fbde

View File

@ -723,7 +723,9 @@ class Function(object):
return
# Note: using defun here avoids an infinite recursion.
@function_lib.defun
# Most of the code in this function runs eagerly with init_scope, where
# autograph is not necessary.
@function_lib.defun(autograph=False)
def initialize_variables():
op_map = object_identity.ObjectIdentityDictionary()
# Stack all the var_is_initialized values into one tensor and intepret the