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

Make tensor_simple.py consistent with Rust and C++ #4060

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

nikolausWest
Copy link
Member

@nikolausWest nikolausWest commented Oct 30, 2023

What

Make tensor_simple.py consistent with Rust and C++ and update screenshot.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested demo.rerun.io (if applicable)
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@nikolausWest nikolausWest added 📖 documentation Improvements or additions to documentation examples Issues relating to the Rerun examples exclude from changelog PRs with this won't show up in CHANGELOG.md labels Oct 30, 2023
@nikolausWest nikolausWest added this to the 0.10 C++ milestone Oct 30, 2023
@nikolausWest
Copy link
Member Author


rng = default_rng(12345)
Copy link
Member Author

Choose a reason for hiding this comment

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

I figured why set a seed in python if we don't for any of the other languages and they don't produce the same value any way

Comment on lines -7 to +5
tensor = rng.uniform(0.0, 1.0, (8, 6, 3, 5)) # 4-dimensional tensor
tensor = np.random.randint(0, 256, (8, 6, 3, 5), dtype=np.uint8) # 4-dimensional tensor
Copy link
Member Author

Choose a reason for hiding this comment

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

C++ and Rust do 0-255 uint8. Note randint takes lower, upper + 1

@abey79 abey79 merged commit 857c8f8 into main Oct 30, 2023
34 checks passed
@abey79 abey79 deleted the niko/update-tensor-example branch October 30, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation examples Issues relating to the Rerun examples exclude from changelog PRs with this won't show up in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants