IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

nan_check_raise

def nan_check_raise[label: StringSlice[StaticConstantOrigin], type_str: StringSlice[StaticConstantOrigin]](nan_count: ManagedTensorSlice[Input, static_spec=nan_count.static_spec], inf_count: ManagedTensorSlice[Input, static_spec=inf_count.static_spec])

Raises an error if NaN or Inf counts are non-zero.

Reads two single-element int32 tensors on the host and raises a diagnostic error if either is > 0.