<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License")
Step1:  Build the C++ "lstpu" example for Coral
This Colab provides a convenient way to build the C++ example named lstpu
Step2:  Download example from GitHub
Step3:  Build lstpu example for Dev Board
Step4:  The following line builds for an ARM64 system (aarch64). Alternative CPU architectures are k8 and armv7a.
Step5:  Download the binary
<ASSISTANT_TASK:>
Python Code:
# 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
#
# https://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.
Explanation: Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License")
End of explanation
! sudo apt install curl
! curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
! echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
! sudo apt update && sudo apt install bazel
Explanation: Build the C++ "lstpu" example for Coral
This Colab provides a convenient way to build the C++ example named lstpu: github.com/google-coral/tflite/tree/master/cpp/examples/lstpu.
Simply run this notebook and it produces the downloadable binary for your target system (default target is aarch64, which is compatible with the Coral Dev Board).
To start the build,  select Runtime > Run all in the Colab toolbar.
<a href="https://colab.research.google.com/github/google-coral/tutorials/blob/master/build_cpp_example_lstpu.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="https://github.com/google-coral/tutorials/blob/master/build_cpp_example_lstpu.ipynb" target="_parent"><img src="https://img.shields.io/static/v1?logo=GitHub&label=&color=333333&style=flat&message=View%20on%20GitHub" alt="View in GitHub"></a>
Install Bazel
End of explanation
! git clone https://github.com/google-coral/tflite.git
Explanation: Download example from GitHub
End of explanation
! sudo apt-get install -y crossbuild-essential-armhf crossbuild-essential-arm64 bazel
%cd tflite/cpp/examples/lstpu
Explanation: Build lstpu example for Dev Board
End of explanation
! make CPU=aarch64
Explanation: The following line builds for an ARM64 system (aarch64). Alternative CPU architectures are k8 and armv7a.
End of explanation
from google.colab import files
files.download('bazel-out/aarch64-opt/bin/lstpu')
Explanation: Download the binary
End of explanation
<END_TASK>