B
    ٻd
                 @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ edg d	e	d
dddejfddZedgd	e	d
dddejfddZej e_ e reZneZd
S )zThe Counter Dataset.    )tf2)
counter_op)dataset_ops)dtypes)deprecation)	tf_exportzdata.experimental.Counter)Zv1Nz+Use `tf.data.Dataset.counter(...)` instead.   c             C   s   t | ||S )a  Creates a `Dataset` that counts from `start` in steps of size `step`.

  Unlike `tf.data.Dataset.range` which will stop at some ending number,
  `Counter` will produce elements indefinitely.

  >>> dataset = tf.data.experimental.Counter().take(5)
  >>> list(dataset.as_numpy_iterator())
  [0, 1, 2, 3, 4]
  >>> dataset.element_spec
  TensorSpec(shape=(), dtype=tf.int64, name=None)
  >>> dataset = tf.data.experimental.Counter(dtype=tf.int32)
  >>> dataset.element_spec
  TensorSpec(shape=(), dtype=tf.int32, name=None)
  >>> dataset = tf.data.experimental.Counter(start=2).take(5)
  >>> list(dataset.as_numpy_iterator())
  [2, 3, 4, 5, 6]
  >>> dataset = tf.data.experimental.Counter(start=2, step=5).take(5)
  >>> list(dataset.as_numpy_iterator())
  [2, 7, 12, 17, 22]
  >>> dataset = tf.data.experimental.Counter(start=10, step=-1).take(5)
  >>> list(dataset.as_numpy_iterator())
  [10, 9, 8, 7, 6]

  Args:
    start: (Optional.) The starting value for the counter. Defaults to 0.
    step: (Optional.) The step size for the counter. Defaults to 1.
    dtype: (Optional.) The data type for counter elements. Defaults to
      `tf.int64`.

  Returns:
    A `Dataset` of scalar `dtype` elements.
  )r   counter)startstepdtype r   a/var/www/html/venv/lib/python3.7/site-packages/tensorflow/python/data/experimental/ops/counter.py	CounterV2   s    #r   c             C   s   t t| ||S )N)r   ZDatasetV1Adapterr   )r
   r   r   r   r   r   	CounterV1>   s    r   )__doc__Ztensorflow.pythonr   Ztensorflow.python.data.opsr   r   Ztensorflow.python.frameworkr   Ztensorflow.python.utilr   Z tensorflow.python.util.tf_exportr   
deprecatedZint64r   r   enabledCounterr   r   r   r   <module>   s    

$

