Rate this Page

torch.compiler.keep_tensor_guards_unsafe#

torch.compiler.keep_tensor_guards_unsafe(guard_entries,keep_parameters=False)[source]#

A common function to keep tensor guards on all tensors. This is unsafe touse by default. But if you don’t expect any changes in the model code, youcan just keep the tensor guards.

>> opt_mod = torch.compile(>> mod,>> options={“guard_filter_fn”: torch.compiler.keep_tensor_guards},>> )