# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import tensorflow as tf

a = tf.constant([9, 8 ,7],name='a')

b = tf.constant([1,2,3], name='b')

soma = a + b

type(a)

print(a)

with tf.Session() as sess:
    print(sess.run(soma))

a1 = tf.constant([[1,2,3], [4,5,6]], name='a1')
type(a1)
print(a1)

a1.shape

b1 = tf.constant([[1, 2, 3], [4, 5, 6]], name='b1')

soma1 = tf.add(a1, b1, name='soma1')

with tf.Session() as sess:
    print(sess.run(a1), end='\n\n')
    print(sess.run(b1), end='\n\n')
    print(sess.run(soma1))


a2 = tf.constant([[1,2,3], [4,5,6]])
b2 = tf.constant([[1], [2]])

with tf.Session() as s:
    print(s.run(a2), end='\n\n')
    print(s.run(b2), end='\n\n')

soma2 = tf.add(a2, b2)

with tf.Session() as s:
    print(s.run(soma2))



StarcoderdataJupyterScriptsDedupFiltered