Rate this Page
★ ★ ★ ★ ★

skip_existing#

tensordict.nn.skip_existing() → bool | list[NestedKey]#

Returns the mode set by set_skip_existing: False (the default), True, or a list of keys.

Examples

>>> from tensordict.nn import set_skip_existing, skip_existing
>>> skip_existing()
False
>>> with set_skip_existing(["a"]):
...     skip_existing()
['a']