# TensorFlow

> A free tool to build and train neural networks, then ship them to apps.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** TensorFlow Library, tf.keras

## Think of it like

It is like a factory line for brains. It builds them and ships them to many places.

## Definition

TensorFlow is a free library to build, train and run neural networks. Most people use it from Python through Keras, its simple way to stack layers. It has tools to run the finished model on phones, in web pages and on servers. It runs on CPUs, graphics cards and special AI chips. Many companies still run older models built with it.

## Example

Google released TensorFlow as open source in November 2015. Jack uses it to put a small photo model inside a phone app.

## Example code

```python
import tensorflow as tf
model = tf.keras.Sequential([tf.keras.layers.Dense(64, activation="relu"), tf.keras.layers.Dense(1)])
model.compile(optimizer="adam", loss="mse")
```

Keras stacks two layers. Then the model is set to train with Adam.

## Why it matters

It is strong at shipping models to phones, browsers and servers. Lots of working systems depend on it.

## Common mistake

Thinking Keras and TensorFlow are rivals. Keras is the simple layer you use on top of it.

## Three principles

- **Build and ship.** Train it, then run it anywhere.
- **Keras on top.** The simple way to stack layers.
- **Many chips.** CPU, graphics card or AI chip.

## Related terms

- [PyTorch](https://learn.benibix.com/term/ai/pytorch)
- [scikit-learn](https://learn.benibix.com/term/ai/scikit-learn)
- [Neural Network](https://learn.benibix.com/term/ai/neural-network)
- [Deep Learning](https://learn.benibix.com/term/ai/deep-learning)
- [Tensor Processing Unit (TPU)](https://learn.benibix.com/term/infrastructure/tensor-processing-unit)

## Taught in

- [scikit-learn and PyTorch](https://learn.benibix.com/learn/ai-machine-learning/scikit-learn-and-pytorch): Machine Learning, 18/18

![Your Python code at the top splits two ways. Left, classic models for table data: scikit-learn and XGBoost, running on a CPU. Right, neural networks: PyTorch and TensorFlow, running on a CPU or a graphics card.](https://learn.benibix.com/diagrams/ai3-ml-frameworks.svg)

---

Source: https://learn.benibix.com/term/ai/tensorflow
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
