Is there a way of specifying an IO manager for ass...
# ask-community
Is there a way of specifying an IO manager for assets only? I frequently want to do that, and its a bit of a pain to manage
hi @Daniel Mosesson -- can you say a bit more? is this a situation where you want there to be some sort of error if an iomanager is applied to a non-asset output, or something else?
I have a number of different assets and other ops in a module, and I want anything that is produced as an asset to use io_manager1, and anything that is for between op computation and the like to use asset_manager2 (or the default one most likely)
ah I see -- and by "between op computation", is this for graph-backed assets, or fully separate op computations?
more the second one, though I do have a few cases of the first
got it -- there's no built in way of doing this, but one pattern we've seen people use pretty successfully is making a custom
decorator. In your case, it'd just need to pass in an
to the existing
(alongside whatever other custom kwargs you want to pass through). This at least takes away the manual effort of having to remember to set that custom key on every single asset
another pattern is to build a custom IOManager that forks its behavior based on if
is None or not
this is actually how the default IOManager works
the first option is something that I should probably be doing anyway