MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / init_variables

Method init_variables

tensorflow/contrib/eager/python/evaluator.py:78–97  ·  view source on GitHub ↗

Return an op for initializing all contained uninitialized variables. Only for graph execution. Should be called after variables are created in the first execution of __call__(). Returns: An op. Raises: RuntimeError: if eager execution is enabled. @compatibility(ea

(self)

Source from the content-addressed store, hash-verified

76 return self.call(self._model.eval_data(*args, **kwargs))
77
78 def init_variables(self):
79 """Return an op for initializing all contained uninitialized variables.
80
81 Only for graph execution. Should be called after variables are created
82 in the first execution of __call__().
83
84 Returns:
85 An op.
86
87 Raises:
88 RuntimeError: if eager execution is enabled.
89
90 @compatibility(eager)
91 Only for graph execution.
92 @end_compatibility
93 """
94 if context.executing_eagerly():
95 raise RuntimeError("Evaluator.init_variables() not needed when "
96 "eager execution is enabled.")
97 return control_flow_ops.group([m.init_variables() for _, m in self.metrics])
98
99 def all_metric_results(self, summary_logdir=None):
100 """Computes results for all contained metrics.

Calls 2

executing_eagerlyMethod · 0.80
groupMethod · 0.45