提交 da55cf6d 编写于 作者: L lizhenyu

fix summary bug of gradient

上级 39b9aedf
......@@ -785,6 +785,9 @@ void SessionBasic::Summary(KernelGraph *graph) {
(void)std::copy(shape.begin(), shape.end(), std::back_inserter(temp_shape));
tensor::TensorPtr tensor = std::make_shared<tensor::Tensor>(type_id, temp_shape);
MS_EXCEPTION_IF_NULL(address);
if (!address->GetPtr()) {
continue;
}
if (!address->SyncDeviceToHost(trans::GetRuntimePaddingShape(node, index), LongToSize(tensor->data().nbytes()),
tensor->data_type(), tensor->data_c(true))) {
MS_LOG(ERROR) << "Failed to sync output from device to host.";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册