@@ -239,6 +239,7 @@ at::Tensor& AtenIpexCPUDev::dil_add_out(
239
239
const std::vector<float > scales{1.0 , alpha.to <float >()};
240
240
dil::sum::compute (scales, {x, y}, z);
241
241
242
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (z.is_public_format () || check_tensor_own_whole_storage (result));
242
243
dbl::comm::sync_shape_from_dil_to_aten (result, z);
243
244
return result;
244
245
}
@@ -267,6 +268,7 @@ at::Tensor & AtenIpexCPUDev::dil_add_(at::Tensor& self, const at::Tensor& other,
267
268
const std::vector<float > scales{1.0 , alpha.to <float >()};
268
269
dil::sum::compute (scales, {dil_self, dil_other}, dil_self);
269
270
271
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (dil_self.is_public_format () || check_tensor_own_whole_storage (self));
270
272
dbl::comm::sync_shape_from_dil_to_aten (self, dil_self);
271
273
return self;
272
274
}
@@ -283,6 +285,7 @@ at::Tensor& AtenIpexCPUDev::dil_mul_out(at::Tensor& result, const at::Tensor& se
283
285
284
286
dil::binary::compute (dil_self, dil_other, dil_result, dil::algorithm::binary_mul);
285
287
288
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (dil_result.is_public_format () || check_tensor_own_whole_storage (result));
286
289
dbl::comm::sync_shape_from_dil_to_aten (result, dil_result);
287
290
return result;
288
291
}
@@ -346,6 +349,7 @@ at::Tensor& AtenIpexCPUDev::dil_bmm_out(
346
349
dil::tensor y = dbl::comm::try_gen_dil_tensor (result);
347
350
matmul_common (x, w, dil::tensor (), y);
348
351
352
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (y.is_public_format () || check_tensor_own_whole_storage (result));
349
353
dbl::comm::sync_shape_from_dil_to_aten (result, y);
350
354
return result;
351
355
}
@@ -390,6 +394,8 @@ at::Tensor& AtenIpexCPUDev::dil_baddbmm_out(
390
394
dil::tensor y = dbl::comm::try_gen_dil_tensor (result);
391
395
auto attr_ = dil::attr_t::fuse_sum ();
392
396
matmul_common (x, w, bias, y, beta, alpha, attr_);
397
+
398
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (y.is_public_format () || check_tensor_own_whole_storage (result));
393
399
dbl::comm::sync_shape_from_dil_to_aten (result, y);
394
400
return result;
395
401
}
@@ -489,6 +495,8 @@ at::Tensor& AtenIpexCPUDev::dil_addbmm_out(
489
495
}
490
496
}
491
497
matmul_common (x_, w_, bias, y, beta, alpha, attr_);
498
+
499
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (y.is_public_format () || check_tensor_own_whole_storage (result));
492
500
dbl::comm::sync_shape_from_dil_to_aten (result, y);
493
501
return result;
494
502
}
@@ -974,6 +982,8 @@ at::Tensor& AtenIpexCPUDev::dil_relu_(at::Tensor& input) {
974
982
dil::algorithm::eltwise_relu,
975
983
dil::prop_kind::forward_training,
976
984
/* alpha*/ 0.0 );
985
+
986
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (dil_self.is_public_format () || check_tensor_own_whole_storage (input));
977
987
dbl::comm::sync_shape_from_dil_to_aten (input, dil_self);
978
988
return input;
979
989
}
@@ -1041,6 +1051,8 @@ at::Tensor& AtenIpexCPUDev::dil_sigmoid_(at::Tensor& self) {
1041
1051
dil::tensor x = dbl::comm::try_gen_dil_tensor (self);
1042
1052
dil::eltwise_forward::compute (
1043
1053
x, x, dil::algorithm::eltwise_logistic_use_dst_for_bwd, dil::prop_kind::forward);
1054
+
1055
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (x.is_public_format () || check_tensor_own_whole_storage (self));
1044
1056
dbl::comm::sync_shape_from_dil_to_aten (self, x);
1045
1057
return self;
1046
1058
}
@@ -1122,6 +1134,8 @@ at::Tensor& AtenIpexCPUDev::dil_cat_out(at::Tensor& result, at::TensorList tenso
1122
1134
}
1123
1135
dil::tensor y = dbl::comm::try_gen_dil_tensor (result);
1124
1136
dil::concat::compute (x, dim, y);
1137
+
1138
+ TORCH_INTERNAL_ASSERT_DEBUG_ONLY (y.is_public_format () || check_tensor_own_whole_storage (result));
1125
1139
dbl::comm::sync_shape_from_dil_to_aten (result, y);
1126
1140
return result;
1127
1141
}
0 commit comments