capture_non_tensor_stack#
- tensordict.capture_non_tensor_stack(allow_none=False)#
Returns whether stacking identical non-tensor data gives one value instead of a stack.
See
set_capture_non_tensor_stack.- Parameters:
allow_none (bool, optional) – if
Trueand the option was never set, returnsNoneinstead of the default (False). Defaults toFalse.
Examples
>>> from tensordict import capture_non_tensor_stack >>> capture_non_tensor_stack() False