Rate this Page
★ ★ ★ ★ ★

composite_lp_aggregate#

tensordict.nn.composite_lp_aggregate(nowarn: bool = False) → bool#

Returns whether a CompositeDistribution sums its log-probabilities in one tensor.

The value also applies to entropies. It is False unless set_composite_lp_aggregate or the COMPOSITE_LP_AGGREGATE environment variable set it to True. See the log-probability key table of ProbabilisticTensorDictModule for what each value changes.

Parameters:

nowarn (bool, optional) – has no effect. It is kept so that calls that pass it keep working. Defaults to False.

Examples

>>> from tensordict.nn import composite_lp_aggregate, set_composite_lp_aggregate
>>> with set_composite_lp_aggregate(True):
...     composite_lp_aggregate()
True