Skip to content

Commit f4732b8

Browse files
committed
set strides from aten to dil tensor
1 parent a310c3b commit f4732b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torch_ipex/csrc/cpu/dbl/Common.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ at::Tensor dil_tensor_to_dense(const at::Tensor& tensor) {
3636

3737
dil::tensor try_gen_dil_tensor(const at::Tensor &input) {
3838
if (cpu::ShadeDataContext::isDilTensor(input)) {
39-
return cpu::ShadeDataContext::getDilTensor(input);
39+
auto dil_tensor = cpu::ShadeDataContext::getDilTensor(input);
40+
if (dil_tensor.is_public_format()) {
41+
dil_tensor.set_dims_and_strides(input.sizes().vec(), input.strides().vec());
42+
}
43+
return dil_tensor;
4044
} else {
4145
return dil_tensor_from_dense(input);
4246
}

0 commit comments

Comments
 (0)