get_defaults_to_none#
- tensordict.get_defaults_to_none(set_to_none: bool = True)#
Returns whether
get()returnsNonefor a missing key.Falsemeans thatgetraises aKeyErrorwhen no default is passed. Seeset_get_defaults_to_none().Deprecated since version 0.15: Since v0.7,
get()returnsNonefor a missing key by default. This function is deprecated and will be removed in TensorDict 0.17. Usetd[key]to raise aKeyErrorfor a missing key.- Parameters:
set_to_none (bool, optional) – ignored. Defaults to
True.