Do not Sync data from device to host if datatype is Monad

This commit is contained in:
liangzelang 2021-08-02 21:16:16 +08:00
parent 2135552c52
commit 9abf49057d
1 changed files with 3 additions and 0 deletions

View File

@ -175,6 +175,9 @@ bool AscendDeviceAddress::SyncDeviceToHost(const ShapeVector &shape, size_t size
void *host_ptr) const {
MS_LOG(INFO) << "SyncDeviceToHost, Device(format:" << format_ << ", type_id:" << TypeIdLabel(type_id_)
<< ", size:" << size_ << "), Host(type_id:" << TypeIdLabel(type) << ", size:" << size << ")";
if (type_id_ > kMonadTypeBegin && type_id_ < kMonadTypeEnd) {
return true;
}
SyncStream();
bool sync_ok = false;
std::vector<size_t> host_shape;