提交 db1ab2cd 编写于 作者: L liuqi

Fix data format bug in MaceTensor.

上级 6fde5497
......@@ -125,7 +125,7 @@ jobs:
- python tools/bazel_adb_run.py --target="//mace/test:mace_api_test" --run_target=False --target_abis=arm64-v8a || exit 1
- python tools/bazel_adb_run.py --target="//mace/test:mace_api_mt_test" --run_target=False --target_abis=arm64-v8a || exit 1
- echo 'Extra Test on ARM64'
- python tools/bazel_adb_run.py --target="//mace/utils:tuner_test" --run_target=False --target_abis=arm64-v8a || exit 1
- python tools/bazel_adb_run.py --target="//mace/utils:utils_test" --run_target=False --target_abis=arm64-v8a || exit 1
env: TYPE=Extra-Test-ARM64-v8a
os: linux
dist: xenial
......
......@@ -20,6 +20,7 @@
#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstring>
#include <fstream>
#include <string>
......
......@@ -293,9 +293,10 @@ MaceTensor::MaceTensor(const std::vector<int64_t> &shape,
std::shared_ptr<float> data,
const DataFormat format) {
MACE_CHECK_NOTNULL(data.get());
MACE_CHECK(format == DataFormat::NHWC || format == DataFormat::NCHW
|| format == OIHW,
"MACE only support NHWC, NCHW and OIHW formats of input now.");
MACE_CHECK(format == DataFormat::DF_NONE || format == DataFormat::NHWC
|| format == DataFormat::NCHW || format == OIHW,
"MACE only support DF_NONE, NHWC, NCHW and OIHW "
"formats of input now.");
impl_ = make_unique<MaceTensor::Impl>();
impl_->shape = shape;
impl_->data = data;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册