提交 7866f724 编写于 作者: L liuqi

Update tensor reshape check when buffer type is image.

上级 9e52599e
...@@ -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.
先完成此消息的编辑!
想要评论请 注册