In [1]:
import tensorflow as tf

# Create TensorFlow object called tensor
hello_constant = tf.constant('Hello World!')

with tf.Session() as sess:
    # Run the tf.constant operation in the session
    output = sess.run(hello_constant)
    print(output)


b'Hello World!'

In [ ]:
from IPython.core.debugger import Pdb

def test_debug(y):
    x = 10
    # One-liner to start the debugger here.
    Pdb().set_trace()
    
    x = x + y
 
    for i in range(10):
        x = x+i
 
    return x
 
test_debug(10)


> <ipython-input-4-aede577f26b0>(8)test_debug()
      6     Pdb().set_trace()
      7 
----> 8     x = x + y
      9 
     10     for i in range(10):

ipdb> x
10
ipdb> y
10
ipdb> y = 50
ipdb> n
> <ipython-input-4-aede577f26b0>(10)test_debug()
      8     x = x + y
      9 
---> 10     for i in range(10):
     11         x = x+i
     12 

ipdb> x
60
ipdb> n
> <ipython-input-4-aede577f26b0>(11)test_debug()
      9 
     10     for i in range(10):
---> 11         x = x+i
     12 
     13     return x

ipdb> n
> <ipython-input-4-aede577f26b0>(10)test_debug()
      8     x = x + y
      9 
---> 10     for i in range(10):
     11         x = x+i
     12 

ipdb> x
60
ipdb> i
0
ipdb> n
> <ipython-input-4-aede577f26b0>(11)test_debug()
      9 
     10     for i in range(10):
---> 11         x = x+i
     12 
     13     return x

ipdb> i
1

In [ ]: