n = np.linspace(-5,5,100)
print(n.shape)
print(n.dtype)

t = tf.linspace(-5.0,5.0,100)

print("_____________________________________________________________________")
print("Printing the output for n and x")
print(t)
print(n)

"""
Explanation: Generating data

Numpy vs Tensorflow

| Numpy | Tensorflow |
| --- | --- |
|shape = .shape| shape = .get_shape(), values are computed and sent over |
| output | output has to be computed as the expression is stored as an TF operation |
End of explanation
"""


g = tf.get_default_graph()
print(g)

[op.name for op in g.get_operations()]

"""
Explanation: As we can see, there is no output for the tensorflow operation here. 
Numpy and Tensorflow being almost the same we can see that tensorflow plays the game a little differently. 
What tensorflow does is, it takes the given expression and stores it as a TF operation which is executed only when the tensor is in a session.

Default Graphs
End of explanation
"""


g.get_tensor_by_name("LinSpace:0")

"""
Explanation: Now we return all the operations which have been added to the graph.
Each of these operations is a Tensor in itself which performs a particular tast.
The last operation takes in the first three operations. We can request the output of any operation which is a tensor, by asking the graph for the Tensor's name.
End of explanation
"""


sess = tf.Session()
sess

computedT = sess.run(t)
print(computedT)
print(t)
sess.close()

"""
Explanation: As we can see here, the result of the TF operation is a TF Tensor.

In order to compute anything in TensorFlow we need to create a TF session. The session is responsible for evaluating the TF graph.
End of explanation
"""


g1 = tf.Graph()
sess = tf.Session(graph=g1)
sess.close()

"""
Explanation: By default TensorFlow gets the default graph to run in the session. 

```
sess = tf.Session(graph = tf.get_default_graph())
```

But one can change this by selecting which graph they want to import by saying.

```
sess = tf.Session(graph = g)
```
Create Graphs
End of explanation
"""


sess = tf.InteractiveSession()

"""
Explanation: Creating an Interactive Session
End of explanation
"""


t.eval()

"""
Explanation: Running the operation without specifying the session for the evaluation.
End of explanation
"""


