ed.get_ancestors
ed.util.get_ancestors
get_ancestors(
x,
collection=None
)
Defined in edward/util/random_variables.py
.
Get ancestor random variables of input.
x
: RandomVariable or tf.Tensor. Query node to find ancestors of.collection
: list of RandomVariable. The collection of random variables to check with respect to; defaults to all random variables in the graph.list of RandomVariable. Ancestor random variables of x.
a = Normal(0.0, 1.0)
b = Normal(a, 1.0)
c = Normal(0.0, 1.0)
d = Normal(b * c, 1.0)
assert set(ed.get_ancestors(d)) == set([a, b, c])