def sample(self, n=None):
if self._bernoulli is None:
self._bernoulli = Bernoulli(self._steps_probs)
sample = self._bernoulli.sample(n)
sample = tf.cumprod(sample, tf.rank(sample) - 1)
sample = tf.reduce_sum(sample, -1)
return sample
评论列表
文章目录