diff --git a/mindspore/lite/example/train_lenet/README.md b/mindspore/lite/example/train_lenet/README.md
new file mode 100644
index 0000000000..8d0c7647b3
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/README.md
@@ -0,0 +1,134 @@
+# Content
+
+
+
+- [Overview](#overview)
+- [Model Architecture](#model-architecture)
+- [Dataset](#dataset)
+- [Environment Requirements](#environment-requirements)
+- [Quick Start](#quick-start)
+- [Script Detailed Description](#script-detailed-description)
+
+
+
+# Overview
+
+This folder holds code for Training-on-Device of a LeNet model. Part of the code runs on a server using MindSpore infrastructure, another part uses MindSpore Lite conversion utility, and the last part is the actual training of the model on some android-based device.
+
+# Model Architecture
+
+LeNet is a very simple network which is composed of only 5 layers, 2 of which are convolutional layers and the remaining 3 are fully connected layers. Such a small network can be fully trained (from scratch) on a device in a short time. Therefore, it is a good example.
+
+# Dataset
+
+In this example we use the MNIST dataset of handwritten digits as published in [THE MNIST DATABASE]()
+
+- Dataset size:52.4M,60,000 28*28 in 10 classes
+ - Test:10,000 images
+ - Train:60,000 images
+- Data format:binary files
+ - Note:Data will be processed in dataset.cc
+
+- The dataset directory structure is as follows:
+
+```python
+mnist/
+├── test
+│ ├── t10k-images-idx3-ubyte
+│ └── t10k-labels-idx1-ubyte
+└── train
+ ├── train-images-idx3-ubyte
+ └── train-labels-idx1-ubyte
+```
+
+# Environment Requirements
+
+- Server side
+ - [MindSpore Framework](https://www.mindspore.cn/install/en): it is recommended to install a docker image
+ - [MindSpore ToD Framework](https://www.mindspore.cn/tutorial/tod/en/use/prparation.html)
+ - [Android NDK r20b](https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip)
+ - [Android SDK](https://developer.android.com/studio?hl=zh-cn#cmdline-tools)
+- A connected Android device
+
+# Quick Start
+
+After installing all the above mentioned, the script in the home directory could be run with the following arguments:
+
+```python
+sh ./prepare_and_run.sh DATASET_PATH [MINDSPORE_DOCKER] [RELEASE.tar.gz]
+```
+
+where:
+
+- DATASET_PATH is the path to the [dataset](#dataset),
+- MINDSPORE_DOCKER is the image name of the docker that runs [MindSpore](#environment-requirements). If not provided MindSpore will be run locally
+- and REALEASE.tar.gz is a pointer to the MindSpore ToD release tar ball. If not provided, the script will attempt to find MindSpore ToD compilation output.
+
+# Script Detailed Description
+
+The provided `prepare_and_run.sh` script is performing the followings:
+
+- Prepare the trainable lenet model in a `.ms` format
+- Prepare the folder that should be pushed into the device
+- Copy this folder into the device and run the scripts on the device
+
+See how to run the script and paramaters definitions in the [Quick Start Section](#quick-start)
+
+## Preparing the model
+
+Within the model folder a `prepare_model.sh` script uses MindSpore infrastructure to export the model into a `.mindir` file. The user can specify a docker image on which MindSpore is installed. Otherwise, the pyhton script will be run locally.
+The script then converts the `.mindir` to a `.ms` format using the MindSpore ToD converter.
+The script accepts a tar ball where the converter resides. Otherwise, the script will attempt to find the converter in the MindSpore ToD build output directory.
+
+## Preparing the Folder
+
+The `lenet_tod.ms` model file is then copied into the `package` folder as well as scripts, the MindSpore ToD library and the MNIST dataset.
+Finally, the code (in src) is compiled for arm64 and the binary is copied into the `package` folder.
+
+### Running the code on the device
+
+To run the code on the device the script first uses `adb` tool to push the `package` folder into the device. It then runs training (which takes some time) and finally runs evaluation of the trained model using the test data.
+
+# Folder Directory tree
+
+``` python
+train_lenet/
+├── Makefile # Makefile of src code
+├── model
+│ ├── lenet_export.py # Python script that exports the LeNet model to .mindir
+│ ├── prepare_model.sh # script that export model (using docker) then converts it
+│ └── train_utils.py # utility function used during the export
+├── prepare_and_run.sh # main script that creates model, compiles it and send to device for running
+├── README.md # this manual
+├── scripts
+│ ├── eval.sh # on-device script that load the train model and evaluates its accuracy
+│ ├── run_eval.sh # adb script that launches eval.sh
+│ ├── run_train.sh # adb script that launches train.sh
+│ └── train.sh # on-device script that load the initial model and train it
+├── src
+│ ├── dataset.cc # dataset handler
+│ ├── dataset.h # dataset class header
+│ ├── net_runner.cc # program that runs training/evaluation of models
+│ └── net_runner.h # net_runner header
+```
+
+When the `prepare_and_run.sh` script is run, the following folder is prepared. It is pushed to the device and then training runs
+
+``` python
+├── package
+│ ├── bin
+│ │ └── net_runner # the executable that performs the training/evaluation
+│ ├── dataset
+│ │ ├── test
+│ │ │ ├── t10k-images-idx3-ubyte # test images
+│ │ │ └── t10k-labels-idx1-ubyte # test labels
+│ │ └── train
+│ │ ├── train-images-idx3-ubyte # train images
+│ │ └── train-labels-idx1-ubyte # train labels
+│ ├── eval.sh # on-device script that load the train model and evaluates its accuracy
+│ ├── lib
+│ │ └── libmindspore-lite.so # MindSpore Lite library
+│ ├── model
+│ │ └── lenet_tod.ms # model to train
+│ └── train.sh # on-device script that load the initial model and train it
+```
diff --git a/mindspore/lite/example/train_lenet/model/lenet_export.py b/mindspore/lite/example/train_lenet/model/lenet_export.py
new file mode 100644
index 0000000000..eddcc47eb0
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/model/lenet_export.py
@@ -0,0 +1,37 @@
+# Copyright 2020 Huawei Technologies Co., Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============================================================================
+"""lenet_export."""
+
+import sys
+from mindspore import context, Tensor
+import mindspore.common.dtype as mstype
+from mindspore.train.serialization import export
+from lenet import LeNet5
+import numpy as np
+from train_utils import TrainWrap
+
+sys.path.append('../../../cv/lenet/src/')
+
+n = LeNet5()
+n.set_train()
+context.set_context(mode=context.PYNATIVE_MODE, device_target="GPU", save_graphs=False)
+
+batch_size = 32
+x = Tensor(np.ones((batch_size, 1, 32, 32)), mstype.float32)
+label = Tensor(np.zeros([batch_size, 10]).astype(np.float32))
+net = TrainWrap(n)
+export(net, x, label, file_name="lenet_tod.mindir", file_format='MINDIR')
+
+print("finished exporting")
diff --git a/mindspore/lite/example/train_lenet/model/prepare_model.sh b/mindspore/lite/example/train_lenet/model/prepare_model.sh
new file mode 100755
index 0000000000..742fbd02c0
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/model/prepare_model.sh
@@ -0,0 +1,24 @@
+CONVERTER="../../../../../mindspore/lite/build/tools/converter/converter_lite"
+if [ ! -f "$CONVERTER" ]; then
+ if ! command -v converter_lite &> /dev/null
+ then
+ echo "converter_lite could not be found in MindSpore build directory nor in system path"
+ exit
+ else
+ CONVERTER=converter_lite
+ fi
+fi
+
+echo "============Exporting=========="
+if [ -n "$1" ]; then
+ DOCKER_IMG=$1
+ docker run -w $PWD --runtime=nvidia -v /home/$USER:/home/$USER --privileged=true ${DOCKER_IMG} /bin/bash -c "python lenet_export.py; chmod 444 lenet_tod.mindir; rm -rf __pycache__"
+else
+ echo "MindSpore docker was not provided, attempting to run locally"
+ python lenet_export.py
+fi
+
+
+echo "============Converting========="
+$CONVERTER --fmk=MINDIR --trainModel=true --modelFile=lenet_tod.mindir --outputFile=lenet_tod
+
diff --git a/mindspore/lite/example/train_lenet/model/train_utils.py b/mindspore/lite/example/train_lenet/model/train_utils.py
new file mode 100644
index 0000000000..7d26d9dac7
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/model/train_utils.py
@@ -0,0 +1,34 @@
+# Copyright 2020 Huawei Technologies Co., Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============================================================================
+"""train_utils."""
+
+import mindspore.nn as nn
+from mindspore.common.parameter import ParameterTuple
+
+def TrainWrap(net, loss_fn=None, optimizer=None, weights=None):
+ """
+ TrainWrap
+ """
+ if loss_fn is None:
+ loss_fn = nn.SoftmaxCrossEntropyWithLogits()
+ loss_net = nn.WithLossCell(net, loss_fn)
+ loss_net.set_train()
+ if weights is None:
+ weights = ParameterTuple(net.trainable_params())
+ if optimizer is None:
+ optimizer = nn.Adam(weights, learning_rate=1e-3, beta1=0.9, beta2=0.999, eps=1e-8, use_locking=False,
+ use_nesterov=False, weight_decay=0.0, loss_scale=1.0)
+ train_net = nn.TrainOneStepCell(loss_net, optimizer)
+ return train_net
diff --git a/mindspore/lite/example/train_lenet/prepare_and_run.sh b/mindspore/lite/example/train_lenet/prepare_and_run.sh
new file mode 100755
index 0000000000..c7f88d1a71
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/prepare_and_run.sh
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+display_usage() {
+ echo -e "\nUsage: prepare_and_run.sh dataset_path [mindspore_docker] [release.tar.gz]\n"
+ }
+
+if [ -n "$1" ]; then
+ MNIST_DATA_PATH=$1
+else
+ echo "MNIST Dataset directory path was not provided"
+ display_usage
+ exit 0
+fi
+
+if [ -n "$2" ]; then
+ DOCKER=$2
+else
+ DOCKER=""
+ #echo "MindSpore docker was not provided"
+ #display_usage
+ #exit 0
+fi
+
+if [ -n "$3" ]; then
+ TARBALL=$3
+else
+ if [ -f ../../../../output/mindspore-lite-*-runtime-arm64-cpu-train.tar.gz ]; then
+ TARBALL="../../../../output/mindspore-lite-*-runtime-arm64-cpu-train.tar.gz"
+ else
+ echo "release.tar.gz was not found"
+ display_usage
+ exit 0
+ fi
+fi
+
+
+# Prepare the model
+cd model/
+rm -f *.ms
+./prepare_model.sh $DOCKER
+cd -
+
+# Copy the .ms model to the package folder
+rm -rf package
+mkdir -p package/model
+cp model/*.ms package/model
+
+# Copy the running script to the package
+cp scripts/train.sh package/
+cp scripts/eval.sh package/
+
+# Copy the shared MindSpore ToD library
+tar -xzvf ${TARBALL} --wildcards --no-anchored libmindspore-lite.so
+tar -xzvf ${TARBALL} --wildcards --no-anchored include
+mv mindspore-*/lib package/
+mkdir msl
+mv mindspore-*/* msl/
+rm -rf mindspore-*
+
+# Copy the dataset to the package
+cp -r ${MNIST_DATA_PATH} package/dataset
+
+# Compile program
+make TARGET=arm64
+
+# Copy the executable to the package
+mv bin package/
+
+# Push the folder to the device
+adb push package /data/local/tmp/
+
+echo "Training on Device"
+adb shell < scripts/run_train.sh
+
+echo
+echo "Load trained model and evaluate accuracy"
+adb shell < scripts/run_eval.sh
+echo
+
+#rm -rf src/*.o package model/__pycache__ model/*.ms
+
+#./prepare_and_run.sh /opt/share/dataset/mnist mindspore_dev:5
diff --git a/mindspore/lite/example/train_lenet/scripts/eval.sh b/mindspore/lite/example/train_lenet/scripts/eval.sh
new file mode 100755
index 0000000000..43890c4028
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/scripts/eval.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Copyright 2020 Huawei Technologies Co., Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============================================================================
+
+# an simple tutorial as follows, more parameters can be setting
+DATA_PATH=$1
+LD_LIBRARY_PATH=./lib/ bin/net_runner -f model/lenet_tod_trained_3000.ms -e 0 -d dataset
diff --git a/mindspore/lite/example/train_lenet/scripts/run_eval.sh b/mindspore/lite/example/train_lenet/scripts/run_eval.sh
new file mode 100644
index 0000000000..8ed3afbe26
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/scripts/run_eval.sh
@@ -0,0 +1,2 @@
+cd /data/local/tmp/package
+/system/bin/sh eval.sh
diff --git a/mindspore/lite/example/train_lenet/scripts/run_train.sh b/mindspore/lite/example/train_lenet/scripts/run_train.sh
new file mode 100644
index 0000000000..d265183a36
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/scripts/run_train.sh
@@ -0,0 +1,2 @@
+cd /data/local/tmp/package
+/system/bin/sh train.sh
diff --git a/mindspore/lite/example/train_lenet/scripts/train.sh b/mindspore/lite/example/train_lenet/scripts/train.sh
new file mode 100755
index 0000000000..ea04581ed5
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/scripts/train.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright 2020 Huawei Technologies Co., Ltd
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============================================================================
+
+# an simple tutorial as follows, more parameters can be setting
+script_self=$(readlink -f "$0")
+self_path=$(dirname "${script_self}")
+DATA_PATH=$1
+LD_LIBRARY_PATH=./lib/ bin/net_runner -f model/lenet_tod.ms -e 3000 -d dataset
diff --git a/mindspore/lite/example/train_lenet/src/dataset.cc b/mindspore/lite/example/train_lenet/src/dataset.cc
new file mode 100644
index 0000000000..b7f0d95767
--- /dev/null
+++ b/mindspore/lite/example/train_lenet/src/dataset.cc
@@ -0,0 +1,200 @@
+/**
+ * Copyright 2020 Huawei Technologies Co., Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "src/dataset.h"
+#include
+#include
+#include