interaction_type#
- tensordict.nn.interaction_type() InteractionType | None#
Returns the interaction type set by
set_interaction_type, orNoneoutside of it.When it returns
None, eachProbabilisticTensorDictModuleuses itsdefault_interaction_type.Examples
>>> from tensordict.nn import interaction_type, set_interaction_type >>> print(interaction_type()) None >>> with set_interaction_type("mode"): ... print(interaction_type()) mode