Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between `tensorflow.nn.np` and `numpy`?

Does tensorflow.nn.np simply call numpy or it is implemented in tensorflow's c++ back-end?

like image 946
Meta Fan Avatar asked Mar 15 '26 07:03

Meta Fan


1 Answers

When in doubt, print out the module.

import tensorflow
print(tensorflow.nn.np)

For me it prints:

<module 'numpy' from '/Users/ch/miniconda/envs/sb35/lib/python3.5/site-packages/numpy/__init__.py'>

So tensorflow.nn.np is just an alias for numpy.

like image 77
cel Avatar answered Mar 17 '26 20:03

cel