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

Fix tf.random.uniform dtype #20843

Closed
wants to merge 1 commit into from
Closed

Fix tf.random.uniform dtype #20843

wants to merge 1 commit into from

Conversation

Rohan138
Copy link
Contributor

@Rohan138 Rohan138 commented Dec 2, 2021

Why are these changes needed?

tf.random.uniform only supports float16, float32, float64, int32, or int64 as of tensorflow 2.7. This raises a ValueError when using, for example, Discrete actions with dtype=uint8 to save memory, like in the SSD environments.

Using tf.cast() is a little 'hacky', but works until tf supports other dtypes. This fix should probably also be applied with modifications in other places e.g. if component is a Box() and so on.

Related issue number

Checks

  • [ Y] 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
    • [Y ] This PR is not tested :(

@Rohan138
Copy link
Contributor Author

Rohan138 commented Dec 2, 2021

Closing in favor of #7946 + will need further modifications to fix dtype errors.

@Rohan138 Rohan138 closed this Dec 2, 2021
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.

None yet

1 participant