ed.get_variables
优质
小牛编辑
129浏览
2023-12-01
Aliases:
ed.get_variables
ed.util.get_variables
get_variables(
x,
collection=None
)
Defined in edward/util/random_variables.py
.
Get parent TensorFlow variables of input.
Args:
x
: RandomVariable or tf.Tensor. Query node to find parents of.collection
: list of tf.Variable. The collection of variables to check with respect to; defaults to all variables in the graph.
Returns:
list of tf.Variable. TensorFlow variables that x depends on.
Examples
a = tf.Variable(0.0)
b = tf.Variable(0.0)
c = Normal(a * b, 1.0)
assert set(ed.get_variables(c)) == set([a, b])