#3. TensorFlow Computation Graph with Eager Execution 
import tensorflow as tf 

# Define tensors in eager mode (default in TF 2.x)
a = tf.constant([5.0, 3.0]) 
b = tf.constant([2.0, 7.0]) 

# Simple addition (eager execution)
c = a + b 
print("Eager Execution Output:", c.numpy())  

# Define a function compiled into a TF graph
@tf.function 
def multiply_tensors(x, y): 
    return x * y 

# Run the graph-mode function
result = multiply_tensors(a, b) 
print("Graph Mode Output:", result.numpy())
