tf.contrib.eager.inf_nan_callback
Stay organized with collections
Save and categorize content based on your preferences.
An execution callback that checks for inf
s and nan
s in output tensors.
tf.contrib.eager.inf_nan_callback(
op_type, inputs, attrs, outputs, op_name, check_inf=True, check_nan=True,
action=tf.contrib.eager.ExecutionCallback.RAISE
)
This callback can be used with tfe.add_execute_callback
to check for invalid
numeric values. E.g.,
tfe.add_execute_callback(tfe.inf_nan_callback)
Args |
op_type
|
Name of the TFE operation type (e.g., MatMul ).
|
inputs
|
The list of input tensors to the operation, currently unused by
this callback.
|
attrs
|
Attributes of the TFE operation, as a tuple of alternating attribute
names and attribute values.
|
outputs
|
The list of output tensors from the operation, checked by this
callback for inf and nan values.
|
op_name
|
Name of the TFE operation. This name is set by client and can be
None if it unset.
|
check_inf
|
(bool ) Whether this callback should check for inf values in
the output tensor values.
|
check_nan
|
(bool ) Whether this callback should check for nan values in
the output tensor values.
|
action
|
(ExecutionCallback ) Action to be taken by the callback when
inf or nan values are detected.
|
Raises |
InfOrNanError
|
iff inf or nan values are seen in any of outputs and
action is "raise" .
|
ValueError
|
iff the value of action is invalid.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.eager.inf_nan_callback\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/eager/execution_callbacks.py#L125-L204) |\n\nAn execution callback that checks for `inf`s and `nan`s in output tensors. \n\n tf.contrib.eager.inf_nan_callback(\n op_type, inputs, attrs, outputs, op_name, check_inf=True, check_nan=True,\n action=tf.contrib.eager.ExecutionCallback.RAISE\n )\n\nThis callback can be used with `tfe.add_execute_callback` to check for invalid\nnumeric values. E.g., \n\n tfe.add_execute_callback(tfe.inf_nan_callback)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------|-------------------------------------------------------------------------------------------------------|\n| `op_type` | Name of the TFE operation type (e.g., `MatMul`). |\n| `inputs` | The `list` of input tensors to the operation, currently unused by this callback. |\n| `attrs` | Attributes of the TFE operation, as a tuple of alternating attribute names and attribute values. |\n| `outputs` | The `list` of output tensors from the operation, checked by this callback for `inf` and `nan` values. |\n| `op_name` | Name of the TFE operation. This name is set by client and can be `None` if it unset. |\n| `check_inf` | (`bool`) Whether this callback should check for `inf` values in the output tensor values. |\n| `check_nan` | (`bool`) Whether this callback should check for `nan` values in the output tensor values. |\n| `action` | (`ExecutionCallback`) Action to be taken by the callback when `inf` or `nan` values are detected. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-----------------|-----------------------------------------------------------------------------------|\n| `InfOrNanError` | iff `inf` or `nan` values are seen in any of `outputs` and `action` is `\"raise\"`. |\n| `ValueError` | iff the value of `action` is invalid. |\n\n\u003cbr /\u003e"]]