提交 5df2f5ac 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5081 [bugfix]LSTM SyncDeviceToHost failed

Merge pull request !5081 from zyli2020/bug_fix
...@@ -32,7 +32,7 @@ namespace device { ...@@ -32,7 +32,7 @@ namespace device {
namespace gpu { namespace gpu {
bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, TypeId, void *host_ptr) const { bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, TypeId, void *host_ptr) const {
MS_EXCEPTION_IF_NULL(host_ptr); MS_EXCEPTION_IF_NULL(host_ptr);
bool need_sync = (size != 0) && (size_ != 0); bool need_sync = (size != 0) && (size_ != 0) && (size <= size_);
if (!need_sync) { if (!need_sync) {
return true; return true;
} }
...@@ -52,7 +52,7 @@ bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, T ...@@ -52,7 +52,7 @@ bool GPUDeviceAddress::SyncDeviceToHost(const std::vector<int> &, size_t size, T
bool GPUDeviceAddress::SyncHostToDevice(const std::vector<int> &, size_t size, TypeId, const void *host_ptr) const { bool GPUDeviceAddress::SyncHostToDevice(const std::vector<int> &, size_t size, TypeId, const void *host_ptr) const {
MS_EXCEPTION_IF_NULL(host_ptr); MS_EXCEPTION_IF_NULL(host_ptr);
bool need_sync = (size != 0) && (size_ != 0); bool need_sync = (size != 0) && (size_ != 0) && (size <= size_);
if (!need_sync) { if (!need_sync) {
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册