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

Function batch_get_value

tensorflow/python/keras/backend.py:3168–3187  ·  view source on GitHub ↗

Returns the value of more than one tensor variable. Arguments: tensors: list of ops to run. Returns: A list of Numpy arrays. Raises: RuntimeError: If this method is called inside defun.

(tensors)

Source from the content-addressed store, hash-verified

3166
3167@keras_export('keras.backend.batch_get_value')
3168def batch_get_value(tensors):
3169 """Returns the value of more than one tensor variable.
3170
3171 Arguments:
3172 tensors: list of ops to run.
3173
3174 Returns:
3175 A list of Numpy arrays.
3176
3177 Raises:
3178 RuntimeError: If this method is called inside defun.
3179 """
3180 if context.executing_eagerly():
3181 return [x.numpy() for x in tensors]
3182 elif ops.inside_function(): # pylint: disable=protected-access
3183 raise RuntimeError('Cannot get value inside Tensorflow graph function.')
3184 if tensors:
3185 return get_session(tensors).run(tensors)
3186 else:
3187 return []
3188
3189
3190@keras_export('keras.backend.set_value')

Callers

nothing calls this directly

Calls 4

executing_eagerlyMethod · 0.80
get_sessionFunction · 0.70
numpyMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected