Like how we import oraclize in Solidity (as follows), is there some way to import tensorflow libraries for machine learning purpose?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
You are thinking incorrectly about what you should be doing in Solidity (that is, on the Ethereum VM.) Solidity is not a general-purpose application development language, and Dapps reference the Ethereum blockchain as a state store with minimal computation - Solidity is a language for smart contracts. To get a sense of what you can/should do on-chain, play with Crypto Zombies.
While you can use the EVM for basic computation, it is exceptionally impractical, extremely expensive, and otherwise unnecessary for things like machine learning. As DenisM states, you can run TF off-chain and reference its results with Oraclize, but you will not be able to run long-running or computationally intensive TF tasks using the micro instance.
You can use Oraclize's computation datasource to do something with TF libraries, from within a docker container, running on an AWS micro instance. The instance can only run up to a max of ~10 minutes (assume 7 or 8 as spin-up is a part of this timer), so account for that if you decide to use it, you can read more on it at the official Oraclize documentation: https://docs.oraclize.it/#data-sources-computation
Any sort of machine-learning computations etc... are highly unlikely to take part on the EVM, as per Vitalik's own words, it's 1 million times more expensive than current mainstream computing, so makes very little sense in machine learning sense, except maybe to share/distribute models, or crowdsource training in some form and making the trained model available on-chain. The computation DS could be used for such an AI crowdsourced training initiative.