ed.get_descendants
优质
小牛编辑
130浏览
2023-12-01
Aliases:
ed.get_descendants
ed.util.get_descendants
get_descendants(
x,
collection=None
)
Defined in edward/util/random_variables.py
.
Get descendant random variables of input.
Args:
x
: RandomVariable or tf.Tensor. Query node to find descendants of.collection
: list of RandomVariable. The collection of random variables to check with respect to; defaults to all random variables in the graph.
Returns:
list of RandomVariable. Descendant random variables of x.
Examples
a = Normal(0.0, 1.0)
b = Normal(a, 1.0)
c = Normal(a, 1.0)
d = Normal(c, 1.0)
assert set(ed.get_descendants(a)) == set([b, c, d])