def __call__(self, values, weights=None, scope=None):
"""Computes the streaming average.
This method builds the fragment of computational graph that computes the streaming
average, returnins a variable representing the actual streaming average value and
an `Op` to update such value.
Arguments:
values: a `Tensor` of arbitrary dimensions.
weights: pptional `Tensor` whose rank is either `0`, or the same rank
as values, and must be broadcastable to values (i.e., all dimensions must
be either `1`, or the same as the corresponding values dimension). It contains
the weights for summing up all the elements in `values`.
scope: a `str` or a `tf.VariableScope` used for building the fragment
of the computational graph that computes the streaming average.
Returns:
mean: a `Tensor` representing the current mean, which is a reference
to `self.value`.
update_op: an `Op` that updates the streaming value, which is a reference
to `self.update_op`.
"""
self.compute(values, weights=weights, scope=scope)
return self.value, self.update_op
评论列表
文章目录