Skip to content

The parameter will be out of scope #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions torch_ipex/csrc/cpu/dbl/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,26 @@ at::Tensor gen_aten_tensor_by(dil::tensor&& dil_tensor) {
shade_data_context->dil_tensor = std::forward<dil::tensor>(dil_tensor);
shade_data_context->data_type = cpu::SHADE_DATA_TYPE::DIL;
void *tensor_data = nullptr;
if (dil_tensor.is_public_format()) {
if (shade_data_context->dil_tensor->is_public_format()) {
// The buffer of a tensor with public format is shared between CPU and DNNL
tensor_data = dil_tensor.get_data_handle();
shade_data_context->cpu_raw_data = dil_tensor.get_data_handle();
tensor_data = shade_data_context->dil_tensor->get_data_handle();
shade_data_context->cpu_raw_data = shade_data_context->dil_tensor->get_data_handle();
shade_data_context->cpu_del_fun = &(c10::detail::deleteNothing);
}
c10::DataPtr shade_data_ptr(
tensor_data,
shade_data_context,
cpu::ShadeDataContext::freeShadeDataContext,
at::DeviceType::DPCPP);
auto at_data_type = get_at_data_type(dil_tensor.get_data_type());
auto at_data_type = get_at_data_type(shade_data_context->dil_tensor->get_data_type());
auto storage_impl = c10::make_intrusive<at::StorageImpl>(
at::scalarTypeToTypeMeta(at_data_type),
dil_tensor.get_nelems(),
shade_data_context->dil_tensor->get_nelems(),
std::move(shade_data_ptr),
nullptr,
/*resizeable=*/false);
auto _tensor = at::detail::make_tensor<torch_ipex::IPEXTensorImpl>(storage_impl, at::DispatchKey::DPCPPTensorId);
dbl::comm::sync_shape_from_dil_to_aten(_tensor, dil_tensor);
dbl::comm::sync_shape_from_dil_to_aten(_tensor, shade_data_context->dil_tensor.value());
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(_tensor.layout() == c10::kStrided);
return _tensor;
}
Expand Down