[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.train.limit_epochs\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/training/input.py#L79-L112) |\n\nReturns tensor `num_epochs` times and then raises an `OutOfRange` error. (deprecated) \n\n tf.compat.v1.train.limit_epochs(\n tensor, num_epochs=None, name=None\n )\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Queue-based input pipelines have been replaced by [`tf.data`](../../../../tf/data). Use `tf.data.Dataset.from_tensors(tensor).repeat(num_epochs)`.\n| **Note:** creates local counter `epochs`. Use `local_variables_initializer()` to initialize local variables.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------|-------------------------------------------------------------------------------------------------------------|\n| `tensor` | Any `Tensor`. |\n| `num_epochs` | A positive integer (optional). If specified, limits the number of steps the output tensor may be evaluated. |\n| `name` | A name for the operations (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| tensor or `OutOfRange`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|-----------------------------|\n| `ValueError` | if `num_epochs` is invalid. |\n\n\u003cbr /\u003e"]]