torch.utils.deterministic#
Created On: Oct 26, 2023 | Last Updated On: Jun 06, 2025
- torch.utils.deterministic.fill_uninitialized_memory#
A
boolthat, if True, causes uninitialized memory to be filled witha known value whentorch.use_deterministic_algorithms()is set toTrue. Floating point and complex values are set to NaN, and integervalues are set to the maximum value.Default:
TrueFilling uninitialized memory is detrimental to performance. So if yourprogram is valid and does not use uninitialized memory as the input to anoperation, then this setting can be turned off for better performance andstill be deterministic.
The following operations will fill uninitialized memory when this setting isturned on:
torch.Tensor.resize_()when called with a tensor that is notquantizedtorch.empty_permuted()