TensorPlay

Latest development documentation · Updated 2026-09-08. A documentation snapshot for package 1.2.0.dev20261027 is not available.

On this page

set_detect_anomaly

class tensorplay.autograd.anomaly_mode.set_detect_anomaly(mode: bool, check_nan: bool = True)[source]

Context-manager that sets the anomaly detection for the autograd engine on or off.

set_detect_anomaly will enable or disable the autograd anomaly detection based on its argument mode. It can be used as a context-manager or as a function.

See detect_anomaly above for details of the anomaly detection behaviour.

Parameters:
  • mode (bool) – Flag whether to enable anomaly detection (True), or disable (False).

  • check_nan (bool) – Flag whether to raise an error when the backward generate “nan”

Search documentation

Search all 1,743 documentation pages.

Keyboard shortcuts

Global

  • /Focus search
  • ?This dialog
  • ,Open settings
  • ⌘jAI assistant

Search

  • ↑↓Navigate results
  • ↵Open result
  • escClose

Package

  • mMain information
  • dDocs
  • .Code
  • -Changelog
  • tTimeline
  • sStats
  • vVersions