nip.utils.data.is_nested_key

Contents

nip.utils.data.is_nested_key#

nip.utils.data.is_nested_key(index: Any) bool[source]#

Check whether an index is a nested key used in TensorDicts.

TensorDicts use nested keys to access values. A nested key is either a string or a tuple of strings.

Parameters:

index (Any) – The index to check.

Returns:

is_nested_key (bool) – Whether the index is a nested key.