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:
parent
a57f2749f2
commit
645b10fbde
@ -723,7 +723,9 @@ class Function(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Note: using defun here avoids an infinite recursion.
|
# 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():
|
def initialize_variables():
|
||||||
op_map = object_identity.ObjectIdentityDictionary()
|
op_map = object_identity.ObjectIdentityDictionary()
|
||||||
# Stack all the var_is_initialized values into one tensor and intepret the
|
# Stack all the var_is_initialized values into one tensor and intepret the
|
||||||
|
Loading…
Reference in New Issue
Block a user