set_cache function

Cache a vector in the graph