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

Function function

tensorflow/python/keras/backend.py:3649–3678  ·  view source on GitHub ↗

Instantiates a Keras function. Arguments: inputs: List of placeholder tensors. outputs: List of output tensors. updates: List of update ops. name: String, name of function. **kwargs: Passed to `tf.Session.run`. Returns: Output values as Numpy arrays. Rais

(inputs, outputs, updates=None, name=None, **kwargs)

Source from the content-addressed store, hash-verified

3647
3648@keras_export('keras.backend.function')
3649def function(inputs, outputs, updates=None, name=None, **kwargs):
3650 """Instantiates a Keras function.
3651
3652 Arguments:
3653 inputs: List of placeholder tensors.
3654 outputs: List of output tensors.
3655 updates: List of update ops.
3656 name: String, name of function.
3657 **kwargs: Passed to `tf.Session.run`.
3658
3659 Returns:
3660 Output values as Numpy arrays.
3661
3662 Raises:
3663 ValueError: if invalid kwargs are passed in or if in eager execution.
3664 """
3665 if ops.executing_eagerly_outside_functions():
3666 if kwargs:
3667 raise ValueError('Session keyword arguments are not support during '
3668 'eager execution. You passed: %s' % (kwargs,))
3669 return EagerExecutionFunction(inputs, outputs, updates=updates, name=name)
3670
3671 if kwargs:
3672 for key in kwargs:
3673 if (key not in tf_inspect.getfullargspec(session_module.Session.run)[0]
3674 and key not in ['inputs', 'outputs', 'updates', 'name']):
3675 msg = ('Invalid argument "%s" passed to K.function with TensorFlow '
3676 'backend') % key
3677 raise ValueError(msg)
3678 return GraphExecutionFunction(inputs, outputs, updates=updates, **kwargs)
3679
3680
3681@keras_export('keras.backend.gradients')

Callers 15

get_valueFunction · 0.70
testMapFusionMethod · 0.50
_testMapAndFilterMethod · 0.50
test_functionMethod · 0.50
expected_resultMethod · 0.50
test_condMethod · 0.50
test_whileMethod · 0.50
test_nested_whileMethod · 0.50
_compute_gradientMethod · 0.50
ApplyMethod · 0.50
Set3DWeightMatrixMethod · 0.50

Calls 2

Tested by 15

testMapFusionMethod · 0.40
_testMapAndFilterMethod · 0.40
test_functionMethod · 0.40
expected_resultMethod · 0.40
test_condMethod · 0.40
test_whileMethod · 0.40
test_nested_whileMethod · 0.40
_compute_gradientMethod · 0.40
ApplyMethod · 0.40
Set3DWeightMatrixMethod · 0.40
SetHashtableValueMethod · 0.40