What is Tensorflow?

So, lets start with what is tensorflow?

Tensorflow is an open-source library with is capable of running machine learning algorithms.It was developed by google brain’s team(Second-gen, DistBelief was the 1st).

Now-a-days it is widely used by many companies, Machine Learning algorithmist, Students, teachers, etc.This library can be used in python mainly. Some interfaces are available to execute and construct graph in C++, Java and Go. Tensorflow also has a JavaScript library.

NOTE: You need to have python3.6 installed (sudo dnf install python3)

Installation of TensorFlow CPU in Fedora

  • In the 1st stage, we need to create a virtual environment(we will use virtualenv [isolated Python environment])pip3 install virtualenv
  • Now let’s create a virtual environment(virtualenv).
    • virtualenv --system-site-packages -p /usr/bin/python3.6 ./venv && source ./venv/bin/activate
  • Now lets install tensorflow
    • pip install tensorflow


  • Now, to move out of the virtual environment type deactivate.

Now lets test our TensorFlow

  • Create a file,
touch mark1.py
nano mark1.py
  • Then write this in the mark1.py file,
import tensorflow as tf

class SquareTest(tf.test.TestCase):
    def testSquare(self):
      with self.test_session():
          x = tf.square([2, 3])
          self.assertAllEqual(x.eval(), [4, 9])

if __name__ == '__main__':


** If you want to learn how to install tensorflow GPU, Please read this