torch.is_anomaly_check_nan_enabled
function is_anomaly_check_nan_enabled(): booleanChecks if anomaly detection specifically checks for NaN values in gradients.
This is a more specific check than general anomaly detection - it only monitors for NaN values rather than Inf or other numerical issues.
NaN detection is not implemented in torch.js. Use
Number.isNaN() to manually check for NaN values in tensor data if needed.Returns
boolean– Always false in torch.js (anomaly detection not implemented)Examples
// Check if NaN detection is enabled
const enabled = torch.is_anomaly_check_nan_enabled();
// torch.js: always falseSee Also
- PyTorch torch.autograd.anomaly_mode.is_anomaly_check_nan_enabled()
- is_anomaly_enabled - General anomaly detection status