清除異步執行中的掛起操作和錯誤狀態。
用法
tf.experimental.async_clear_error()
在異步執行模式下,操作/函數執行中的錯誤可能會導致後續已計劃但尚未執行的操作/函數發生錯誤。調用此方法會清除所有掛起的操作並重置異步執行狀態。
例子:
while True:
try:
# Step function updates the metric `loss` internally
train_step_fn()
except tf.errors.OutOfRangeError:
tf.experimental.async_clear_error()
break
logging.info('loss = %s', loss.numpy())
相關用法
- Python tf.experimental.async_scope用法及代碼示例
- Python tf.experimental.dlpack.from_dlpack用法及代碼示例
- Python tf.experimental.numpy.iinfo用法及代碼示例
- Python tf.experimental.Optional.has_value用法及代碼示例
- Python tf.experimental.dispatch_for_unary_elementwise_apis用法及代碼示例
- Python tf.experimental.dispatch_for_api用法及代碼示例
- Python tf.experimental.unregister_dispatch_for用法及代碼示例
- Python tf.experimental.tensorrt.Converter用法及代碼示例
- Python tf.experimental.ExtensionType用法及代碼示例
- Python tf.experimental.Optional.get_value用法及代碼示例
- Python tf.experimental.numpy.issubdtype用法及代碼示例
- Python tf.experimental.numpy.unicode_用法及代碼示例
- Python tf.experimental.dlpack.to_dlpack用法及代碼示例
- Python tf.experimental.Optional.empty用法及代碼示例
- Python tf.experimental.numpy.float16.as_integer_ratio用法及代碼示例
- Python tf.experimental.numpy.float64.as_integer_ratio用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.experimental.async_clear_error。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。