| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent eb00d1d commit aee5dcc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,7 +206,8 @@ def random_uniform(shape, | |||
| 206 | 206 | maxval: A 0-D Tensor or Python value of type `dtype`. The upper bound on | |
| 207 | 207 | the range of random values to generate. Defaults to 1 if `dtype` is | |
| 208 | 208 | floating point. | |
| 209 | - dtype: The type of the output: `float32`, `float64`, `int32`, or `int64`. | ||
| 209 | + dtype: The type of the output: 'float16`, `float32`, `float64`, `int32`, | ||
| 210 | + or `int64`. | ||
| 210 | 211 | seed: A Python integer. Used to create a random seed for the distribution. | |
| 211 | 212 | See @{tf.set_random_seed} | |
| 212 | 213 | for behavior. | |
@@ -219,6 +220,9 @@ def random_uniform(shape, | |||
| 219 | 220 | ValueError: If `dtype` is integral and `maxval` is not specified. | |
| 220 | 221 | """ | |
| 221 | 222 | dtype = dtypes.as_dtype(dtype) | |
| 223 | + if dtype not in (dtypes.float16, dtypes.float32, dtypes.float64, dtypes.int32, | ||
| 224 | + dtypes.int64): | ||
| 225 | + raise ValueError("Invalid dtype %r" % dtype) | ||
| 222 | 226 | if maxval is None: | |
| 223 | 227 | if dtype.is_integer: | |
| 224 | 228 | raise ValueError("Must specify maxval for integer dtype %r" % dtype) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments