Created
March 7, 2020 18:12
-
-
Save novasush/907334be75e30ecf443a046306e43b77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the number of CPU cores. | |
cores = multiprocessing.cpu_count() | |
print(cores) | |
# Parallelize the transformation of the train_dataset by using | |
# the map operation with the number of parallel calls set to | |
# the number of CPU cores. | |
train_dataset = train_dataset.map(read_tfrecord,num_parallel_calls=cores) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment