import tensorflow.compat.v1 as tf
import numpy as np
### Define a model: a computational graph
# Parameters for a linear model y = Wx + b
# Placeholder for input and prediction
x1 = tf.placeholder(dtype=tf.float32, shape=[1, 5])
x2 = tf.placeholder(dtype=tf.float32, shape=[1, 2, 5])
x3 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x4 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x5 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x6 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x7 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x8 = tf.placeholder(dtype=tf.float32, shape=[None,5])
x = [x1, x2, x3, x4, x5, x6, x7, x8]
# Define output = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8
output = tf.math.add_n(x)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
summary_writer = tf.summary.FileWriter('./', sess.graph)
a = np.array([[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
[3, 3, 3]])
b = np.array([1, 2, 3])
print(a.shape)
print(b.shape)
print(a + b)
#
# with tf.Session() as sess:
# # Retrieve the variable initializer op and initialize variable W & b.
# sess.run(tf.global_variables_initializer())
# for i in range(1000):
# sess.run(train, {x:x_train, y:y_train})
# if i%100==0:
# l_cost = sess.run(loss, {x:x_train, y:y_train})
# print(f"i: {i} cost: {l_cost}")