DEV Community

Rishit Dagli
Rishit Dagli

Posted on • Originally published at twitter.com

3 1

đź’ˇTensorFlow Tip, use .cache

đź’ˇ#TensorFlowTip

Use .cache to save on some ops like opening file and reading data during each epoch

  • transformations before cache are only run for 1st epoch
  • can cache in-memory or on-disk
  • not repeatedly perform expensive CPU ops

See the speedup with .cache in this image.

Alt Text

Try it out for yourself:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
view raw caching.ipynb hosted with ❤ by GitHub

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay