!9776 fix heterogeneity SyncHostToDevice failed

From: @zhaosida1994
Reviewed-by: @chujinjin,@zhoufeng54
Signed-off-by: @chujinjin
pull/9776/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 8bd2143500

@ -575,7 +575,7 @@ bool AscendDeviceAddress::ConvertFormatAndSyncHostToDevice(const ShapeVector &sh
host_shape.emplace_back(1); host_shape.emplace_back(1);
} }
std::vector<size_t> device_shape; std::vector<size_t> device_shape;
if (format_ == kOpFormat_FRAC_NZ || format_ == kOpFormat_NCDHW || kOpFormat_NDC1HWC0) { if (format_ == kOpFormat_FRAC_NZ || format_ == kOpFormat_NCDHW || format_ == kOpFormat_NDC1HWC0) {
device_shape = trans::TransShapeToDevice(host_shape, format_); device_shape = trans::TransShapeToDevice(host_shape, format_);
} else { } else {
host_shape = trans::PaddingShapeTo4d(host_shape); host_shape = trans::PaddingShapeTo4d(host_shape);

Loading…
Cancel
Save