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 to use by default. But if you donโ€™t expect any changes in the model code, you can just keep the tensor guards.

>> opt_mod = torch.compile( >> mod, >> options={โ€œguard_filter_fnโ€: torch.compiler.keep_tensor_guards}, >> )