nip.utils.torch.TensorDictCloneKeys#
- class nip.utils.torch.TensorDictCloneKeys(*args, **kwargs)[source]#
 Clone the keys of a TensorDict.
- Parameters:
 in_keys (NestedKey | Iterable[NestedKey]) – The keys to clone.
out_keys (NestedKey | Iterable[NestedKey]) – The keys to store the cloned values in.
Methods Summary
__init__(in_keys, out_keys)Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(tensordict)Clone the keys of the input TensorDict.
Attributes
T_destinationcall_super_initdump_patchesin_keysout_keysout_keys_sourcetrainingMethods
- __init__(in_keys: str | tuple[str | tuple[NestedKey, ...], ...] | Iterable[str | tuple[str | tuple[NestedKey, ...], ...]], out_keys: str | tuple[str | tuple[NestedKey, ...], ...] | Iterable[str | tuple[str | tuple[NestedKey, ...], ...]])[source]#
 Initialize internal Module state, shared by both nn.Module and ScriptModule.
- forward(tensordict: TensorDictBase) TensorDictBase[source]#
 Clone the keys of the input TensorDict.
- Parameters:
 tensordict (TensorDictBase) – The input TensorDict.
- Returns:
 cloned_tensordict (TensorDictBase) – The input TensorDict with the keys cloned.