Use of underscore in interger values or Number values in Tensorflow documentation

Viewed 42
1 Answers

The underscores are for improved readability, but do not have any deeper meaning. See this for more information. Here is an example:

import tensorflow

ds1 = tf.data.Dataset.random(seed=4).take(2_000)
print(len(list(ds1.map(lambda x: x))))
ds1 = tf.data.Dataset.random(seed=4).take(200_000)
print(len(list(ds1.map(lambda x: x))))
2000
200000
Related