torch.clear_autocast_cache
function clear_autocast_cache(): voidClears the autocast dtype and shape cache.
Autocast maintains a cache of dtype decisions for operations to improve performance. This function clears that cache, forcing recalculation of dtype choices. This is rarely needed in practice.
This is a no-op in torch.js since autocast caching is not implemented.
Returns
void
Examples
// Clear autocast cache (useful after changing autocast settings)
torch.clear_autocast_cache();