未验证 提交 03117c2d 编写于 作者: T TFLM-bot 提交者: GitHub

Automated sync from github.com/tensorflow/tensorflow (#75)

上级 8da1c45d
......@@ -348,7 +348,7 @@ cc_library(
":kernel_util",
":micro_utils",
":xtensa",
"@flatbuffers",
"@flatbuffers//:runtime_cc",
"//tensorflow/lite/c:common",
"//tensorflow/lite/kernels:kernel_util",
"//tensorflow/lite/kernels:op_macros",
......@@ -620,7 +620,7 @@ cc_test(
"//tensorflow/lite/kernels/internal:tensor",
"//tensorflow/lite/micro:test_helpers",
"//tensorflow/lite/micro/testing:micro_test",
"@flatbuffers",
"@flatbuffers//:runtime_cc",
],
)
......
......@@ -49,24 +49,45 @@ if [ -d ${DOWNLOADED_GCC_PATH} ]; then
echo >&2 "${DOWNLOADED_GCC_PATH} already exists, skipping the download."
else
UNAME_S=`uname -s`
if [ ${UNAME_S} == Linux ]; then
HOST_OS=
if [ "${OS}" == "Windows_NT" ]; then
HOST_OS=windows
else
UNAME_S=`uname -s`
if [ "${UNAME_S}" == "Linux" ]; then
HOST_OS=linux
elif [ "${UNAME_S}" == "Darwin" ]; then
HOST_OS=osx
fi
fi
if [ "${HOST_OS}" == "linux" ]; then
GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2"
EXPECTED_MD5="8312c4c91799885f222f663fc81f9a31"
elif [ ${UNAME_S} == Darwin ]; then
elif [ "${HOST_OS}" == "osx" ]; then
GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2"
EXPECTED_MD5="e588d21be5a0cc9caa60938d2422b058"
elif [ "${HOST_OS}" == "windows" ]; then
GCC_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-win32.zip"
EXPECTED_MD5="5ee6542a2af847934177bc8fa1294c0d"
else
echo "OS type ${UNAME_S} not supported."
echo "OS type ${HOST_OS} not supported."
exit 1
fi
TEMPFILE=$(mktemp -d)/temp_file
TEMPDIR=$(mktemp -d)
TEMPFILE=${TEMPDIR}/temp_file
wget ${GCC_URL} -O ${TEMPFILE} >&2
check_md5 ${TEMPFILE} ${EXPECTED_MD5}
mkdir ${DOWNLOADED_GCC_PATH}
tar -C ${DOWNLOADED_GCC_PATH} --strip-components=1 -xjf ${TEMPFILE} >&2
if [ "${HOST_OS}" == "windows" ]; then
unzip -q ${TEMPFILE} -d ${TEMPDIR} >&2
mv ${TEMPDIR}/*/* ${DOWNLOADED_GCC_PATH}
else
tar -C ${DOWNLOADED_GCC_PATH} --strip-components=1 -xjf ${TEMPFILE} >&2
fi
echo >&2 "Unpacked to directory: ${DOWNLOADED_GCC_PATH}"
fi
......
#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -94,14 +94,14 @@ else
FLATBUFFERS_URL="http://mirror.tensorflow.org/github.com/google/flatbuffers/archive/${ZIP_PREFIX}.zip"
FLATBUFFERS_MD5="aa9adc93eb9b33fa1a2a90969e48baee"
TMPDIR="$(mktemp -d)"
TMPFILE="${TMPDIR}/${ZIP_PREFIX}.zip"
wget ${FLATBUFFERS_URL} -O "$TMPFILE" >&2
check_md5 "${TMPFILE}" ${FLATBUFFERS_MD5}
TEMPDIR="$(mktemp -d)"
TEMPFILE="${TEMPDIR}/${ZIP_PREFIX}.zip"
wget ${FLATBUFFERS_URL} -O "$TEMPFILE" >&2
check_md5 "${TEMPFILE}" ${FLATBUFFERS_MD5}
unzip -qo "$TMPFILE" -d "${TMPDIR}" >&2
mv "${TMPDIR}/flatbuffers-${ZIP_PREFIX}" ${DOWNLOADED_FLATBUFFERS_PATH}
rm -rf "${TMPDIR}"
unzip -qo "$TEMPFILE" -d "${TEMPDIR}" >&2
mv "${TEMPDIR}/flatbuffers-${ZIP_PREFIX}" ${DOWNLOADED_FLATBUFFERS_PATH}
rm -rf "${TEMPDIR}"
patch_to_avoid_strtod ${DOWNLOADED_FLATBUFFERS_PATH}/include/flatbuffers/flexbuffers.h
delete_build_files ${DOWNLOADED_FLATBUFFERS_PATH}
......
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
# ARM Cortex M makefile targeted for a FVP based on Arm Corstone-300 software.
# For more info see: tensorflow/lite/micro/cortex_m_corstone_300/README.md
......@@ -88,10 +103,13 @@ ifneq ($(filter cortex-m55%,$(TARGET_ARCH)),)
endif
ifeq ($(TOOLCHAIN), gcc)
export PATH := $(MAKEFILE_DIR)/downloads/gcc_embedded/bin/:$(PATH)
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/arm_gcc_download.sh ${MAKEFILE_DIR}/downloads)
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
$(error Something went wrong with the GCC download: $(DOWNLOAD_RESULT))
TARGET_DEFAULT_TOOLCHAIN_ROOT := $(MAKEFILE_DIR)/downloads/gcc_embedded/bin/
TARGET_TOOLCHAIN_ROOT := $(TARGET_DEFAULT_TOOLCHAIN_ROOT)
ifeq ($(TARGET_TOOLCHAIN_ROOT), $(TARGET_DEFAULT_TOOLCHAIN_ROOT))
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/arm_gcc_download.sh ${MAKEFILE_DIR}/downloads)
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
$(error Something went wrong with the GCC download: $(DOWNLOAD_RESULT))
endif
endif
TARGET_TOOLCHAIN_PREFIX := arm-none-eabi-
......
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================
# Generic Makefile target for ARM Cortex M builds.
# For more info see: tensorflow/lite/micro/cortex_m_generic/README.md
......@@ -95,10 +110,13 @@ ifeq ($(TOOLCHAIN), armclang)
MICROLITE_LIBS := $(filter-out -lm,$(MICROLITE_LIBS))
else ifeq ($(TOOLCHAIN), gcc)
export PATH := $(MAKEFILE_DIR)/downloads/gcc_embedded/bin/:$(PATH)
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/arm_gcc_download.sh ${MAKEFILE_DIR}/downloads)
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
$(error Something went wrong with the GCC download: $(DOWNLOAD_RESULT))
TARGET_DEFAULT_TOOLCHAIN_ROOT := $(MAKEFILE_DIR)/downloads/gcc_embedded/bin/
TARGET_TOOLCHAIN_ROOT := $(TARGET_DEFAULT_TOOLCHAIN_ROOT)
ifeq ($(TARGET_TOOLCHAIN_ROOT), $(TARGET_DEFAULT_TOOLCHAIN_ROOT))
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/arm_gcc_download.sh ${MAKEFILE_DIR}/downloads)
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
$(error Something went wrong with the GCC download: $(DOWNLOAD_RESULT))
endif
endif
TARGET_TOOLCHAIN_PREFIX := arm-none-eabi-
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册