tensorflow / tensorflow/probability

Gamma sampler raises a UserWarning in recent nightly versions

Open
#1,072 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

In tfp-nightly-dev20200831, drawing a sample from Gamma distribution raises a warning
UserWarning: Explicitly requested dtype <class 'jax.numpy.lax_numpy.float64'> requested in astype is not available, and will be truncated to dtype float32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable.

from tensorflow_probability.substrates.jax import distributions as tfd
from jax import random
tfd.Gamma(1, 1).sample(seed=random.PRNGKey(0))

This does not happen in dev20200810 version, so I think it is a regression.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning with the supplied Gamma sampling snippet in tfp-nightly-dev20200831 and compare it with dev20200810. Trace the JAX Gamma sampling path to identify the regression; done means the example runs without this UserWarning while preserving sampling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.