
import tensorflow as tf

tf.compat.v1.enable_eager_execution()  # Enable eager execution for TensorFlow 1.x compatibility mode

# Step 1: Define inputs
x = tf.constant(2.0)
y = tf.constant(3.0)

# Step 2: Define operations
z = tf.add(x, y)  # z = x + y
w = tf.multiply(z, 2.0)  # w = 2 * z

# Step 3: Define variables
weights = tf.Variable(initial_value=0.5)
output = tf.multiply(w, weights)  # output = w * weights

# Step 4: Execute and print the result
print("Output:", output.numpy())
