<jupyter_start><jupyter_text>Variables<jupyter_code>x = 1
y = x + 9
print (y)
x = tf.Variable(3)
y = tf.Variable(4)
#z=3
f = x*x*y + y + 2
sess = tf.Session()
sess.run(x.initializer)
sess.run(y.initializer)
result = sess.run(f)
print(result)<jupyter_output>42<jupyter_text>Defining multidemensional array<jupyter_code>scaler = tf.constant([2])
vector = tf.constant([3,4,5])
matrix = tf.constant([[1,2,3],[3,4,6],[9,5,2]])
tensor = tf.constant([[[1,2,3],[3,4,6],[9,5,2]],[[1,4,6],[6,4,0],[3,5,2]],[[0,2,5],[3,3,6],[2,5,1]]])
with tf.Session() as session:
    result=session.run(scaler)
    print('Scaler:\n',result)
    
    result=session.run(vector)
    print('Vector:\n',result)
with tf.Session() as session:    
    result=session.run(matrix)
    print('Matrix:\n',result)
with tf.Session() as session:    
    tensor=session.run(tensor)
    print('Tensor:\n',tensor)
print(tensor[2][2])<jupyter_output>[2 5 1]<jupyter_text>Numpy<jupyter_code>import numpy as np
tensor_2d = np.array([(1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12)])
print (tensor_2d[0][:3])<jupyter_output>[1 2 3]<jupyter_text>Placeholder<jupyter_code>a=tf.placeholder(tf.float32)
b=a*2
with tf.Session() as session:
    result=session.run(b, feed_dict={a:3.5})
    print(result)<jupyter_output>7.0<jupyter_text>Placeholder pass the data with feed_dict argument<jupyter_code>dictionary = {a: [[1,2,3],[3,4,6],[9,5,2]]}
with tf.Session() as session:
    result=session.run(b, feed_dict=dictionary)
    print(result)<jupyter_output>[[ 2.  4.  6.]
 [ 6.  8. 12.]
 [18. 10.  4.]]
{'fraction_non_alphanumeric': 0.2133592736705577, 'fraction_numerical': 0.06679636835278858, 'mean_word_length': 5.650862068965517, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '416054', 'license': 'Apache-1.1', 'n_tokens_mistral': 722, 'n_tokens_neox': 675, 'n_words': 107, 'path': 'Example_2_Placeholder_Variables_Tensor.ipynb', 'repo_name': 'shakirul15-311/learn.tensorflow', 'size': '1542'}