Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Datasets] Improve to_tf docstring #29464

Merged
merged 18 commits into from
Nov 4, 2022

Conversation

bveeramani
Copy link
Member

@bveeramani bveeramani commented Oct 19, 2022

Signed-off-by: Balaji [email protected]

Depends on:

Why are these changes needed?

The Dataset.to_tf docstring is out-of-date, and it doesn't contain examples. This PR updates the docstring content and adds docstring examples.

Related issue number

See #29028

Closes #29202

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Comment on lines 2840 to 2842
If your dataset contains ragged tensors, this method errors. To prevent
errors, resize tensors or
:ref:`disable tensor extension casting <disable_tensor_extension_casting>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only blocker for this is that schema inference breaks for ragged tensors; IMO we should provide an optional output_signature argument that bypasses schema inference (I think this is a generically good thing to have), at which point ragged tensors would currently be supported via specifying an output_signature with the appropriate ragged tensor spec.

disable tensor extension casting

For .to_tf(), I don't think that ragged tensors will work, even with tensor extension casting disabled. I think the only route is resizing the tensors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#29476 adds support for ragged tensors and removes this warning.

python/ray/data/dataset.py Show resolved Hide resolved
python/ray/data/dataset.py Show resolved Hide resolved
python/ray/data/dataset.py Show resolved Hide resolved
Copy link
Contributor

@clarkzinzow clarkzinzow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@krfricke krfricke merged commit 34029df into ray-project:master Nov 4, 2022
WeichenXu123 pushed a commit to WeichenXu123/ray that referenced this pull request Dec 19, 2022
The `Dataset.to_tf` docstring is out-of-date, and it doesn't contain examples. This PR updates the docstring content and adds docstring examples.

Signed-off-by: Balaji Veeramani <[email protected]>
Co-authored-by: Clark Zinzow <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Datasets] Add docstring examples for to_tf
3 participants