W3cubDocs

/TensorFlow Python

tf.contrib.metrics.streaming_concat(values, axis=0, max_size=None, metrics_collections=None, updates_collections=None, name=None)

tf.contrib.metrics.streaming_concat(values, axis=0, max_size=None, metrics_collections=None, updates_collections=None, name=None)

See the guide: Metrics (contrib) > Metric Ops

Concatenate values along an axis across batches.

The function streaming_concat creates two local variables, array and size, that are used to store concatenated values. Internally, array is used as storage for a dynamic array (if maxsize is None), which ensures that updates can be run in amortized constant time.

For estimation of the metric over a stream of data, the function creates an update_op operation that appends the values of a tensor and returns the value of the concatenated tensors.

This op allows for evaluating metrics that cannot be updated incrementally using the same framework as other streaming metrics.

Args:

  • values: Tensor to concatenate. Rank and the shape along all axes other than the axis to concatenate along must be statically known.
  • axis: optional integer axis to concatenate along.
  • max_size: optional integer maximum size of value along the given axis. Once the maximum size is reached, further updates are no-ops. By default, there is no maximum size: the array is resized as necessary.
  • metrics_collections: An optional list of collections that value should be added to.
  • updates_collections: An optional list of collections update_op should be added to.
  • name: An optional variable_scope name.

Returns:

  • value: A Tensor representing the concatenated values.
  • update_op: An operation that concatenates the next values.

Raises:

  • ValueError: if values does not have a statically known rank, axis is not in the valid range or the size of values is not statically known along any axis other than axis.

Defined in tensorflow/contrib/metrics/python/ops/metric_ops.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/metrics/streaming_concat