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

Method eval

tensorflow/python/ops/variables.py:689–719  ·  view source on GitHub ↗

In a session, computes and returns the value of this variable. This is not a graph construction method, it does not add ops to the graph. This convenience method requires a session where the graph containing this variable has been launched. If no session is passed, the default sess

(self, session=None)

Source from the content-addressed store, hash-verified

687 raise NotImplementedError
688
689 def eval(self, session=None):
690 """In a session, computes and returns the value of this variable.
691
692 This is not a graph construction method, it does not add ops to the graph.
693
694 This convenience method requires a session where the graph
695 containing this variable has been launched. If no session is
696 passed, the default session is used. See `tf.compat.v1.Session` for more
697 information on launching a graph and on sessions.
698
699 ```python
700 v = tf.Variable([1, 2])
701 init = tf.compat.v1.global_variables_initializer()
702
703 with tf.compat.v1.Session() as sess:
704 sess.run(init)
705 # Usage passing the session explicitly.
706 print(v.eval(sess))
707 # Usage with the default session. The 'with' block
708 # above makes 'sess' the default session.
709 print(v.eval())
710 ```
711
712 Args:
713 session: The session to use to evaluate this variable. If none, the
714 default session is used.
715
716 Returns:
717 A numpy `ndarray` with a copy of the value of this variable.
718 """
719 raise NotImplementedError
720
721 @deprecated(
722 None, "Use Variable.read_value. Variables in 2.X are initialized "

Callers 15

testPrintVariableMethod · 0.95
test_variableMethod · 0.95
doTestSparseMethod · 0.95
testSharingMethod · 0.95
testAggregationMethodMethod · 0.95
testConstraintMethod · 0.95
doTestBasicMethod · 0.95
testNesterovMomentumMethod · 0.95

Calls

no outgoing calls

Tested by 15

testPrintVariableMethod · 0.76
test_variableMethod · 0.76
doTestSparseMethod · 0.76
testSharingMethod · 0.76
testAggregationMethodMethod · 0.76
testConstraintMethod · 0.76
doTestBasicMethod · 0.76
testNesterovMomentumMethod · 0.76