PyTorch torch.get_deterministic_debug_mode 函数
torch.get_deterministic_debug_mode 是 PyTorch 中用于获取确定性调试模式的函数。
函数定义
torch.get_deterministic_debug_mode()
使用示例
实例
import torch
# 获取当前的确定性调试模式
mode = torch.get_deterministic_debug_mode()
print("当前确定性调试模式:", mode)
# 获取当前的确定性调试模式
mode = torch.get_deterministic_debug_mode()
print("当前确定性调试模式:", mode)
返回值说明:
- 0 - 关闭
- 1 - 开启但只警告
- 2 - 开启且报错

Pytorch torch 参考手册