Bug- False "UserWarning: Explicitly requested dtype <class 'jax.numpy.int64'> requested in astype is not available, and will be truncated to dtype int32
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python, tensorflow
调研方向
首先,使用 TensorFlow Probability 的 JAX substrate 和 OneHotCategorical.sample 入口运行提供的 Python 复现代码。跟踪分类样本被转换为整数数据类型的位置;当复现代码不再发出警告,同时保留报告中的 float32 输出时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Python 3.9.19 (main, May 6 2024, 19:43:03)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jax
>>> import tensorflow_probability.substrates.jax as tfp
>>> tfd = tfp.distributions
>>> rng = jax.random.PRNGKey(0)
>>> tfd.OneHotCategorical(logits=jax.random.normal(key=rng,shape=(3,4)), dtype=jax.numpy.float32).sample(seed=rng)
/home/user/anaconda3/envs/ml_exp/lib/python3.9/site-packages/jax/_src/numpy/array_methods.py:68: UserWarning: Explicitly requested dtype <class 'jax.numpy.int64'> requested in astype is not available, and will be truncated to dtype int32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable. See https://github.com/google/jax#current-gotchas for more.
return lax_numpy.astype(arr, dtype, copy=copy, device=device)
Array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 0., 1.]], dtype=float32)
I explicitly set jnp.float32 and did not ask for int anywhere, but received the warning
- 主要语言
- Jupyter Notebook
- 星标
- 4.4k
- 派生
- 1.1k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tensorflow/probability 的其他 Issue
-
KL divergence between two `TransformedDistribution`s with a shared non-injective bijector (`AbsoluteValue`) returns the base KL可能已有人在做 @Andreas-Hum 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
tensorflow/probability#2036 ·
-
难度 3/5 1-2 天 新手友好度 68/100
tensorflow/probability#2034 ·
-
难度 5/5 一周以上 新手友好度 35/100
tensorflow/probability#2021 ·
-
难度 4/5 3-5 天 新手友好度 30/100
tensorflow/probability#2015 ·
-
难度 3/5 1-2 天 新手友好度 48/100
tensorflow/probability#2013 ·
查看 tensorflow/probability 的全部 Issue
相似的 Issue
-
training
难度 2/5 1-3 小时 新手友好度 72/100
tinaudio/synth-setter#3758 ·
维护者通常 1 天内回复
-
bot-triaged module: correctness (silent) module: data module: error checking triage review
难度 2/5 1-3 小时 新手友好度 71/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
vllm-project/vllm-ascend#21392 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复