From 2dcbbe3ec7d6c065014ab6bc2b9900f4038c6d90 Mon Sep 17 00:00:00 2001 From: rmothukuru <48206667+rmothukuru@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:10:11 +0530 Subject: [PATCH] Update errors_impl.py Added the Code example for `tf.errors.ResourceExhaustedError` --- tensorflow/python/framework/errors_impl.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tensorflow/python/framework/errors_impl.py b/tensorflow/python/framework/errors_impl.py index 78a124ba05a..6325ae6106d 100644 --- a/tensorflow/python/framework/errors_impl.py +++ b/tensorflow/python/framework/errors_impl.py @@ -384,6 +384,16 @@ class ResourceExhaustedError(OpError): For example, this error might be raised if a per-user quota is exhausted, or perhaps the entire file system is out of space. + + Example: + + >>> try: + >>> session = tf.compat.v1.Session() + >>> sess.run(node_output, feed_dict={node_input : value_input}) + >>> except tf.errors.ResourceExhaustedError as e: + >>> config = tf.compat.v1.ConfigProto() + >>> config.gpu_options.allow_growth = True + >>> session = tf.compat.v1.Session(config=config) @@__init__ """