Skip to main content
 首页 » 编程设计

python之keras 中的 get_source_inputs 函数

2024年10月01日7pander-it

keras 中 get_source_inputs() 函数的用途是什么。我在文档中看不到任何关于此的信息。

from keras.engine.topology import get_source_inputs 

谢谢!

请您参考如下方法:

From the source code :

def get_source_inputs(tensor, layer=None, node_index=None):

Returns the list of input tensors necessary to compute tensor.

Output will always be a list of tensors (potentially with 1 element).

Arguments

tensor: The tensor to start from.

layer: Origin layer of the tensor. Will be determined via tensor._keras_history if not provided.

node_index: Origin node index of the tensor.

Returns List of input tensors.