InteractionType¶
- class tensordict.nn.InteractionType(value)¶
A list of possible interaction types with a distribution.
MODE, MEDIAN and MEAN point to the property / attribute with the same name. RANDOM points to
rsample()if that method exists orsample()if not.DETERMINISTIC can be used as a generic fallback if
MEANorMODEare not guaranteed to be analytically tractable. In such cases, a rude deterministic estimate can be used in some cases even if it lacks a true algebraic meaning. This value will trigger a query to thedeterministic_sampleattribute in the distribution and if it does not exist, themeanwill be used.- classmethod from_str(type_str: str) InteractionType¶
Return the interaction_type with name matched to the provided string (case insensitive).