提交 e1c7df94 编写于 作者: 李寅

Merge branch 'update-tensor-reshape' into 'master'

Update tensor reshape check when buffer type is image.

See merge request !697
...@@ -217,7 +217,11 @@ class Tensor { ...@@ -217,7 +217,11 @@ class Tensor {
inline void Reshape(const std::vector<index_t> &shape) { inline void Reshape(const std::vector<index_t> &shape) {
shape_ = shape; shape_ = shape;
MACE_CHECK(raw_size() <= buffer_->size()); if (has_opencl_image()) {
MACE_CHECK(raw_size() <= 4 * buffer_->size());
} else {
MACE_CHECK(raw_size() <= buffer_->size());
}
} }
inline MaceStatus Resize(const std::vector<index_t> &shape) { inline MaceStatus Resize(const std::vector<index_t> &shape) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册