Skip to content

Caching of images #4344

Answered by dmadisetti
tmct asked this question in Q&A
Apr 1, 2025 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hey Tom- glad you are getting use out of caching.

Here's a super straight-forward way of doing this:

image_cached = mo.cache(mo.image)
image_cached("https://upload.wikimedia.org/wikipedia/en/b/b6/Dramatic_Chipmunk.png")

Key thing to remember is cache just captures the compute but not outputs. You could also do:

with mo.cache("my_image"):
    img = mo.image(...)
img

Hope that helps!

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tmct
Comment options

@tmct
Comment options

@tmct
Comment options

@tmct
Comment options

Answer selected by tmct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants