Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/source/data/api/dataset.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ Developer API
block.BlockExecStats
block.BlockMetadata
block.BlockAccessor

Deprecated API
--------------

.. currentmodule:: ray.data

.. autosummary::
:nosignatures:
:toctree: doc/

Dataset.iter_tf_batches
7 changes: 6 additions & 1 deletion python/ray/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -4018,7 +4018,7 @@ def iter_torch_batches(
)

@ConsumptionAPI
@PublicAPI(api_group=CD_API_GROUP)
@Deprecated
def iter_tf_batches(
self,
*,
Expand Down Expand Up @@ -4091,6 +4091,11 @@ def iter_tf_batches(
:meth:`Dataset.iter_batches`
Call this method to manually convert your data to TensorFlow tensors.
""" # noqa: E501
warnings.warn(
"`iter_tf_batches` is deprecated and will be removed after May 2025. Use "
"`to_tf` instead.",
DeprecationWarning,
)
return self.iterator().iter_tf_batches(
prefetch_batches=prefetch_batches,
batch_size=batch_size,
Expand Down
5 changes: 5 additions & 0 deletions python/ray/data/tests/test_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,11 @@ def test_union(ray_start_regular_shared):
assert ds2.count() == 210


def test_iter_tf_batches_emits_deprecation_warning(ray_start_regular_shared):
with pytest.warns(DeprecationWarning):
ray.data.range(1).iter_tf_batches()


@pytest.mark.skipif(
sys.version_info >= (3, 12), reason="No tensorflow for Python 3.12+"
)
Expand Down
Loading