@ptrblck, sorry for the delayed response.
Precisely !
I do a fresh login:
 python --version
Python 2.7.15 :: Anaconda, Inc.

 which python
/home/yash/anaconda2/bin/python


Then I source the environment: source activate py2pytorch
Then the status is:
python --version
Python 3.6.5 :: Anaconda, Inc.

which python
/home/yash/anaconda2/envs/py2pytorch/bin/python

I also did as you asked:
print(torch.__file__)

/home/yash/anaconda2/envs/py2pytorch/lib/python3.6/site-packages/torch/__init__.py

So the environment inside anaconda2 is python 3.6 ?!
Thanks again !