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

Function eval

tensorflow/python/keras/backend.py:1247–1265  ·  view source on GitHub ↗

Evaluates the value of a variable. Arguments: x: A variable. Returns: A Numpy array. Examples: ```python >>> from keras import backend as K >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32') >>> K.eval(kvar) array([[ 1., 2.], [ 3., 4.]], dtyp

(x)

Source from the content-addressed store, hash-verified

1245
1246@keras_export('keras.backend.eval')
1247def eval(x):
1248 """Evaluates the value of a variable.
1249
1250 Arguments:
1251 x: A variable.
1252
1253 Returns:
1254 A Numpy array.
1255
1256 Examples:
1257 ```python
1258 >>> from keras import backend as K
1259 >>> kvar = K.variable(np.array([[1, 2], [3, 4]]), dtype='float32')
1260 >>> K.eval(kvar)
1261 array([[ 1., 2.],
1262 [ 3., 4.]], dtype=float32)
1263 ```
1264 """
1265 return get_value(to_dense(x))
1266
1267
1268@keras_export('keras.backend.zeros')

Callers 4

testReprMethod · 0.50
evaluateMethod · 0.50
TESTFunction · 0.50

Calls 2

get_valueFunction · 0.85
to_denseFunction · 0.85

Tested by 2

testReprMethod · 0.40
TESTFunction · 0.40